| 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/svg/SVGDocumentExtensions.h" | 39 #include "core/svg/SVGDocumentExtensions.h" |
| 40 #include "core/svg/SVGFontElement.h" | 40 #include "core/svg/SVGFontElement.h" |
| 41 #include "core/svg/SVGFontFaceSrcElement.h" | 41 #include "core/svg/SVGFontFaceSrcElement.h" |
| 42 #include "core/svg/SVGGlyphElement.h" | 42 #include "core/svg/SVGGlyphElement.h" |
| 43 #include "platform/fonts/Font.h" | 43 #include "platform/fonts/Font.h" |
| 44 | 44 |
| 45 namespace WebCore { | 45 namespace WebCore { |
| 46 | 46 |
| 47 using namespace SVGNames; | 47 using namespace SVGNames; |
| 48 | 48 |
| 49 SVGFontFaceElement::SVGFontFaceElement(Document& document) | 49 inline SVGFontFaceElement::SVGFontFaceElement(Document& document) |
| 50 : SVGElement(font_faceTag, document) | 50 : SVGElement(font_faceTag, document) |
| 51 , m_fontFaceRule(StyleRuleFontFace::create()) | 51 , m_fontFaceRule(StyleRuleFontFace::create()) |
| 52 , m_fontElement(0) | 52 , m_fontElement(0) |
| 53 , m_weakFactory(this) | 53 , m_weakFactory(this) |
| 54 { | 54 { |
| 55 ScriptWrappable::init(this); | 55 ScriptWrappable::init(this); |
| 56 RefPtrWillBeRawPtr<MutableStylePropertySet> styleDeclaration = MutableStyleP
ropertySet::create(HTMLStandardMode); | 56 RefPtrWillBeRawPtr<MutableStylePropertySet> styleDeclaration = MutableStyleP
ropertySet::create(HTMLStandardMode); |
| 57 m_fontFaceRule->setProperties(styleDeclaration.release()); | 57 m_fontFaceRule->setProperties(styleDeclaration.release()); |
| 58 } | 58 } |
| 59 | 59 |
| 60 DEFINE_NODE_FACTORY(SVGFontFaceElement) |
| 61 |
| 60 static CSSPropertyID cssPropertyIdForFontFaceAttributeName(const QualifiedName&
attrName) | 62 static CSSPropertyID cssPropertyIdForFontFaceAttributeName(const QualifiedName&
attrName) |
| 61 { | 63 { |
| 62 if (!attrName.namespaceURI().isNull()) | 64 if (!attrName.namespaceURI().isNull()) |
| 63 return CSSPropertyInvalid; | 65 return CSSPropertyInvalid; |
| 64 | 66 |
| 65 static HashMap<StringImpl*, CSSPropertyID>* propertyNameToIdMap = 0; | 67 static HashMap<StringImpl*, CSSPropertyID>* propertyNameToIdMap = 0; |
| 66 if (!propertyNameToIdMap) { | 68 if (!propertyNameToIdMap) { |
| 67 propertyNameToIdMap = new HashMap<StringImpl*, CSSPropertyID>; | 69 propertyNameToIdMap = new HashMap<StringImpl*, CSSPropertyID>; |
| 68 // This is a list of all @font-face CSS properties which are exposed as
SVG XML attributes | 70 // This is a list of all @font-face CSS properties which are exposed as
SVG XML attributes |
| 69 // Those commented out are not yet supported by WebCore's style system | 71 // Those commented out are not yet supported by WebCore's style system |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 | 351 |
| 350 void SVGFontFaceElement::trace(Visitor* visitor) | 352 void SVGFontFaceElement::trace(Visitor* visitor) |
| 351 { | 353 { |
| 352 visitor->trace(m_fontFaceRule); | 354 visitor->trace(m_fontFaceRule); |
| 353 SVGElement::trace(visitor); | 355 SVGElement::trace(visitor); |
| 354 } | 356 } |
| 355 | 357 |
| 356 } // namespace WebCore | 358 } // namespace WebCore |
| 357 | 359 |
| 358 #endif // ENABLE(SVG_FONTS) | 360 #endif // ENABLE(SVG_FONTS) |
| OLD | NEW |