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 Apple Inc. All rights reserved. | 4 * Copyright (C) 2008 Apple Inc. 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 28 matching lines...) Expand all Loading... |
39 #include "core/platform/graphics/Font.h" | 39 #include "core/platform/graphics/Font.h" |
40 #include "core/svg/SVGDocumentExtensions.h" | 40 #include "core/svg/SVGDocumentExtensions.h" |
41 #include "core/svg/SVGFontElement.h" | 41 #include "core/svg/SVGFontElement.h" |
42 #include "core/svg/SVGFontFaceSrcElement.h" | 42 #include "core/svg/SVGFontFaceSrcElement.h" |
43 #include "core/svg/SVGGlyphElement.h" | 43 #include "core/svg/SVGGlyphElement.h" |
44 | 44 |
45 namespace WebCore { | 45 namespace WebCore { |
46 | 46 |
47 using namespace SVGNames; | 47 using namespace SVGNames; |
48 | 48 |
49 inline SVGFontFaceElement::SVGFontFaceElement(const QualifiedName& tagName, Docu
ment* document) | 49 inline SVGFontFaceElement::SVGFontFaceElement(const QualifiedName& tagName, Docu
ment& document) |
50 : SVGElement(tagName, document) | 50 : SVGElement(tagName, document) |
51 , m_fontFaceRule(StyleRuleFontFace::create()) | 51 , m_fontFaceRule(StyleRuleFontFace::create()) |
52 , m_fontElement(0) | 52 , m_fontElement(0) |
53 { | 53 { |
54 ASSERT(hasTagName(font_faceTag)); | 54 ASSERT(hasTagName(font_faceTag)); |
55 ScriptWrappable::init(this); | 55 ScriptWrappable::init(this); |
56 RefPtr<MutableStylePropertySet> styleDeclaration = MutableStylePropertySet::
create(CSSStrictMode); | 56 RefPtr<MutableStylePropertySet> styleDeclaration = MutableStylePropertySet::
create(CSSStrictMode); |
57 m_fontFaceRule->setProperties(styleDeclaration.release()); | 57 m_fontFaceRule->setProperties(styleDeclaration.release()); |
58 } | 58 } |
59 | 59 |
60 PassRefPtr<SVGFontFaceElement> SVGFontFaceElement::create(const QualifiedName& t
agName, Document* document) | 60 PassRefPtr<SVGFontFaceElement> SVGFontFaceElement::create(const QualifiedName& t
agName, Document& document) |
61 { | 61 { |
62 return adoptRef(new SVGFontFaceElement(tagName, document)); | 62 return adoptRef(new SVGFontFaceElement(tagName, document)); |
63 } | 63 } |
64 | 64 |
65 static CSSPropertyID cssPropertyIdForSVGAttributeName(const QualifiedName& attrN
ame) | 65 static CSSPropertyID cssPropertyIdForSVGAttributeName(const QualifiedName& attrN
ame) |
66 { | 66 { |
67 if (!attrName.namespaceURI().isNull()) | 67 if (!attrName.namespaceURI().isNull()) |
68 return CSSPropertyInvalid; | 68 return CSSPropertyInvalid; |
69 | 69 |
70 static HashMap<StringImpl*, CSSPropertyID>* propertyNameToIdMap = 0; | 70 static HashMap<StringImpl*, CSSPropertyID>* propertyNameToIdMap = 0; |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 | 348 |
349 void SVGFontFaceElement::childrenChanged(bool changedByParser, Node* beforeChang
e, Node* afterChange, int childCountDelta) | 349 void SVGFontFaceElement::childrenChanged(bool changedByParser, Node* beforeChang
e, Node* afterChange, int childCountDelta) |
350 { | 350 { |
351 SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, chil
dCountDelta); | 351 SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, chil
dCountDelta); |
352 rebuildFontFace(); | 352 rebuildFontFace(); |
353 } | 353 } |
354 | 354 |
355 } // namespace WebCore | 355 } // namespace WebCore |
356 | 356 |
357 #endif // ENABLE(SVG_FONTS) | 357 #endif // ENABLE(SVG_FONTS) |
OLD | NEW |