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 26 matching lines...) Expand all Loading... |
37 , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::
create(LengthModeHeight), ForbidNegativeLengths)) | 37 , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::
create(LengthModeHeight), ForbidNegativeLengths)) |
38 { | 38 { |
39 addToPropertyMap(m_x); | 39 addToPropertyMap(m_x); |
40 addToPropertyMap(m_y); | 40 addToPropertyMap(m_y); |
41 addToPropertyMap(m_width); | 41 addToPropertyMap(m_width); |
42 addToPropertyMap(m_height); | 42 addToPropertyMap(m_height); |
43 | 43 |
44 UseCounter::count(document, UseCounter::SVGForeignObjectElement); | 44 UseCounter::count(document, UseCounter::SVGForeignObjectElement); |
45 } | 45 } |
46 | 46 |
| 47 void SVGForeignObjectElement::trace(Visitor* visitor) |
| 48 { |
| 49 visitor->trace(m_x); |
| 50 visitor->trace(m_y); |
| 51 visitor->trace(m_width); |
| 52 visitor->trace(m_height); |
| 53 SVGGraphicsElement::trace(visitor); |
| 54 } |
| 55 |
47 DEFINE_NODE_FACTORY(SVGForeignObjectElement) | 56 DEFINE_NODE_FACTORY(SVGForeignObjectElement) |
48 | 57 |
49 bool SVGForeignObjectElement::isSupportedAttribute(const QualifiedName& attrName
) | 58 bool SVGForeignObjectElement::isSupportedAttribute(const QualifiedName& attrName
) |
50 { | 59 { |
51 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 60 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
52 if (supportedAttributes.isEmpty()) { | 61 if (supportedAttributes.isEmpty()) { |
53 supportedAttributes.add(SVGNames::xAttr); | 62 supportedAttributes.add(SVGNames::xAttr); |
54 supportedAttributes.add(SVGNames::yAttr); | 63 supportedAttributes.add(SVGNames::yAttr); |
55 supportedAttributes.add(SVGNames::widthAttr); | 64 supportedAttributes.add(SVGNames::widthAttr); |
56 supportedAttributes.add(SVGNames::heightAttr); | 65 supportedAttributes.add(SVGNames::heightAttr); |
57 } | 66 } |
58 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 67 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
59 } | 68 } |
60 | 69 |
61 void SVGForeignObjectElement::parseAttribute(const QualifiedName& name, const At
omicString& value) | 70 void SVGForeignObjectElement::parseAttribute(const QualifiedName& name, const At
omicString& value) |
62 { | 71 { |
63 parseAttributeNew(name, value); | 72 parseAttributeNew(name, value); |
64 } | 73 } |
65 | 74 |
66 bool SVGForeignObjectElement::isPresentationAttribute(const QualifiedName& name)
const | 75 bool SVGForeignObjectElement::isPresentationAttribute(const QualifiedName& name)
const |
67 { | 76 { |
68 if (name == SVGNames::widthAttr || name == SVGNames::heightAttr) | 77 if (name == SVGNames::widthAttr || name == SVGNames::heightAttr) |
69 return true; | 78 return true; |
70 return SVGGraphicsElement::isPresentationAttribute(name); | 79 return SVGGraphicsElement::isPresentationAttribute(name); |
71 } | 80 } |
72 | 81 |
73 void SVGForeignObjectElement::collectStyleForPresentationAttribute(const Qualifi
edName& name, const AtomicString& value, MutableStylePropertySet* style) | 82 void SVGForeignObjectElement::collectStyleForPresentationAttribute(const Qualifi
edName& name, const AtomicString& value, MutableStylePropertySet* style) |
74 { | 83 { |
75 if (name == SVGNames::widthAttr || name == SVGNames::heightAttr) { | 84 if (name == SVGNames::widthAttr || name == SVGNames::heightAttr) { |
76 RefPtr<SVGLength> length = SVGLength::create(LengthModeOther); | 85 RefPtrWillBeRawPtr<SVGLength> length = SVGLength::create(LengthModeOther
); |
77 TrackExceptionState exceptionState; | 86 TrackExceptionState exceptionState; |
78 length->setValueAsString(value, exceptionState); | 87 length->setValueAsString(value, exceptionState); |
79 if (!exceptionState.hadException()) { | 88 if (!exceptionState.hadException()) { |
80 if (name == SVGNames::widthAttr) | 89 if (name == SVGNames::widthAttr) |
81 addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth,
value); | 90 addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth,
value); |
82 else if (name == SVGNames::heightAttr) | 91 else if (name == SVGNames::heightAttr) |
83 addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight
, value); | 92 addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight
, value); |
84 } | 93 } |
85 } else { | 94 } else { |
86 SVGGraphicsElement::collectStyleForPresentationAttribute(name, value, st
yle); | 95 SVGGraphicsElement::collectStyleForPresentationAttribute(name, value, st
yle); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 147 |
139 bool SVGForeignObjectElement::selfHasRelativeLengths() const | 148 bool SVGForeignObjectElement::selfHasRelativeLengths() const |
140 { | 149 { |
141 return m_x->currentValue()->isRelative() | 150 return m_x->currentValue()->isRelative() |
142 || m_y->currentValue()->isRelative() | 151 || m_y->currentValue()->isRelative() |
143 || m_width->currentValue()->isRelative() | 152 || m_width->currentValue()->isRelative() |
144 || m_height->currentValue()->isRelative(); | 153 || m_height->currentValue()->isRelative(); |
145 } | 154 } |
146 | 155 |
147 } // namespace blink | 156 } // namespace blink |
OLD | NEW |