Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: Source/core/svg/SVGFontElement.cpp

Issue 23886003: Have HTMLElements / SVGElements constructors take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Another Android build fix Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/svg/SVGFontElement.h ('k') | Source/core/svg/SVGFontFaceElement.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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)
OLDNEW
« no previous file with comments | « Source/core/svg/SVGFontElement.h ('k') | Source/core/svg/SVGFontFaceElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698