OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> | 3 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 #include "XLinkNames.h" | 24 #include "XLinkNames.h" |
25 #include "core/frame/UseCounter.h" | 25 #include "core/frame/UseCounter.h" |
26 #include "core/rendering/svg/RenderSVGForeignObject.h" | 26 #include "core/rendering/svg/RenderSVGForeignObject.h" |
27 #include "core/rendering/svg/RenderSVGResource.h" | 27 #include "core/rendering/svg/RenderSVGResource.h" |
28 #include "core/svg/SVGLength.h" | 28 #include "core/svg/SVGLength.h" |
29 #include "wtf/Assertions.h" | 29 #include "wtf/Assertions.h" |
30 | 30 |
31 namespace WebCore { | 31 namespace WebCore { |
32 | 32 |
33 SVGForeignObjectElement::SVGForeignObjectElement(Document& document) | 33 inline SVGForeignObjectElement::SVGForeignObjectElement(Document& document) |
34 : SVGGraphicsElement(SVGNames::foreignObjectTag, document) | 34 : SVGGraphicsElement(SVGNames::foreignObjectTag, document) |
35 , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(Len
gthModeWidth), AllowNegativeLengths)) | 35 , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(Len
gthModeWidth), AllowNegativeLengths)) |
36 , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(Len
gthModeHeight), AllowNegativeLengths)) | 36 , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(Len
gthModeHeight), AllowNegativeLengths)) |
37 , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::cr
eate(LengthModeWidth), ForbidNegativeLengths)) | 37 , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::cr
eate(LengthModeWidth), ForbidNegativeLengths)) |
38 , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::
create(LengthModeHeight), ForbidNegativeLengths)) | 38 , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::
create(LengthModeHeight), ForbidNegativeLengths)) |
39 { | 39 { |
40 ScriptWrappable::init(this); | 40 ScriptWrappable::init(this); |
41 | 41 |
42 addToPropertyMap(m_x); | 42 addToPropertyMap(m_x); |
43 addToPropertyMap(m_y); | 43 addToPropertyMap(m_y); |
44 addToPropertyMap(m_width); | 44 addToPropertyMap(m_width); |
45 addToPropertyMap(m_height); | 45 addToPropertyMap(m_height); |
46 | 46 |
47 UseCounter::count(document, UseCounter::SVGForeignObjectElement); | 47 UseCounter::count(document, UseCounter::SVGForeignObjectElement); |
48 } | 48 } |
49 | 49 |
| 50 DEFINE_NODE_FACTORY(SVGForeignObjectElement) |
| 51 |
50 bool SVGForeignObjectElement::isSupportedAttribute(const QualifiedName& attrName
) | 52 bool SVGForeignObjectElement::isSupportedAttribute(const QualifiedName& attrName
) |
51 { | 53 { |
52 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 54 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
53 if (supportedAttributes.isEmpty()) { | 55 if (supportedAttributes.isEmpty()) { |
54 supportedAttributes.add(SVGNames::xAttr); | 56 supportedAttributes.add(SVGNames::xAttr); |
55 supportedAttributes.add(SVGNames::yAttr); | 57 supportedAttributes.add(SVGNames::yAttr); |
56 supportedAttributes.add(SVGNames::widthAttr); | 58 supportedAttributes.add(SVGNames::widthAttr); |
57 supportedAttributes.add(SVGNames::heightAttr); | 59 supportedAttributes.add(SVGNames::heightAttr); |
58 } | 60 } |
59 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 61 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 156 |
155 bool SVGForeignObjectElement::selfHasRelativeLengths() const | 157 bool SVGForeignObjectElement::selfHasRelativeLengths() const |
156 { | 158 { |
157 return m_x->currentValue()->isRelative() | 159 return m_x->currentValue()->isRelative() |
158 || m_y->currentValue()->isRelative() | 160 || m_y->currentValue()->isRelative() |
159 || m_width->currentValue()->isRelative() | 161 || m_width->currentValue()->isRelative() |
160 || m_height->currentValue()->isRelative(); | 162 || m_height->currentValue()->isRelative(); |
161 } | 163 } |
162 | 164 |
163 } | 165 } |
OLD | NEW |