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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 { | 89 { |
90 if (name == SVGNames::widthAttr || name == SVGNames::heightAttr) | 90 if (name == SVGNames::widthAttr || name == SVGNames::heightAttr) |
91 return true; | 91 return true; |
92 return SVGGraphicsElement::isPresentationAttribute(name); | 92 return SVGGraphicsElement::isPresentationAttribute(name); |
93 } | 93 } |
94 | 94 |
95 void SVGForeignObjectElement::collectStyleForPresentationAttribute(const Qualifi
edName& name, const AtomicString& value, MutableStylePropertySet* style) | 95 void SVGForeignObjectElement::collectStyleForPresentationAttribute(const Qualifi
edName& name, const AtomicString& value, MutableStylePropertySet* style) |
96 { | 96 { |
97 if (name == SVGNames::widthAttr || name == SVGNames::heightAttr) { | 97 if (name == SVGNames::widthAttr || name == SVGNames::heightAttr) { |
98 RefPtr<SVGLength> length = SVGLength::create(LengthModeOther); | 98 RefPtr<SVGLength> length = SVGLength::create(LengthModeOther); |
99 length->setValueAsString(value, IGNORE_EXCEPTION); | 99 TrackExceptionState exceptionState; |
100 if (length->unitType() != LengthTypeUnknown) { | 100 length->setValueAsString(value, exceptionState); |
| 101 if (!exceptionState.hadException()) { |
101 if (name == SVGNames::widthAttr) | 102 if (name == SVGNames::widthAttr) |
102 addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth,
length->valueAsString()); | 103 addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth,
value); |
103 else if (name == SVGNames::heightAttr) | 104 else if (name == SVGNames::heightAttr) |
104 addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight
, length->valueAsString()); | 105 addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight
, value); |
105 } | 106 } |
106 } else { | 107 } else { |
107 SVGGraphicsElement::collectStyleForPresentationAttribute(name, value, st
yle); | 108 SVGGraphicsElement::collectStyleForPresentationAttribute(name, value, st
yle); |
108 } | 109 } |
109 } | 110 } |
110 | 111 |
111 void SVGForeignObjectElement::svgAttributeChanged(const QualifiedName& attrName) | 112 void SVGForeignObjectElement::svgAttributeChanged(const QualifiedName& attrName) |
112 { | 113 { |
113 if (!isSupportedAttribute(attrName)) { | 114 if (!isSupportedAttribute(attrName)) { |
114 SVGGraphicsElement::svgAttributeChanged(attrName); | 115 SVGGraphicsElement::svgAttributeChanged(attrName); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 160 |
160 bool SVGForeignObjectElement::selfHasRelativeLengths() const | 161 bool SVGForeignObjectElement::selfHasRelativeLengths() const |
161 { | 162 { |
162 return m_x->currentValue()->isRelative() | 163 return m_x->currentValue()->isRelative() |
163 || m_y->currentValue()->isRelative() | 164 || m_y->currentValue()->isRelative() |
164 || m_width->currentValue()->isRelative() | 165 || m_width->currentValue()->isRelative() |
165 || m_height->currentValue()->isRelative(); | 166 || m_height->currentValue()->isRelative(); |
166 } | 167 } |
167 | 168 |
168 } | 169 } |
OLD | NEW |