Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(713)

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGRectElement.cpp

Issue 1481123002: Use SVGLength's wrapped CSSPrimitiveValue for pres.attr. style (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 || attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr 109 || attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr
110 || attrName == SVGNames::rxAttr || attrName == SVGNames::ryAttr) 110 || attrName == SVGNames::rxAttr || attrName == SVGNames::ryAttr)
111 return true; 111 return true;
112 return SVGGeometryElement::isPresentationAttributeWithSVGDOM(attrName); 112 return SVGGeometryElement::isPresentationAttributeWithSVGDOM(attrName);
113 } 113 }
114 114
115 void SVGRectElement::collectStyleForPresentationAttribute(const QualifiedName& n ame, const AtomicString& value, MutableStylePropertySet* style) 115 void SVGRectElement::collectStyleForPresentationAttribute(const QualifiedName& n ame, const AtomicString& value, MutableStylePropertySet* style)
116 { 116 {
117 RefPtrWillBeRawPtr<SVGAnimatedPropertyBase> property = propertyFromAttribute (name); 117 RefPtrWillBeRawPtr<SVGAnimatedPropertyBase> property = propertyFromAttribute (name);
118 if (property == m_x) 118 if (property == m_x)
119 addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyX, *m _x->currentValue()); 119 addPropertyToPresentationAttributeStyle(style, CSSPropertyX, m_x->curren tValue()->asCSSPrimitiveValue());
120 else if (property == m_y) 120 else if (property == m_y)
121 addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyY, *m _y->currentValue()); 121 addPropertyToPresentationAttributeStyle(style, CSSPropertyY, m_y->curren tValue()->asCSSPrimitiveValue());
122 else if (property == m_width) 122 else if (property == m_width)
123 addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyWidth , *m_width->currentValue()); 123 addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth, m_width ->currentValue()->asCSSPrimitiveValue());
124 else if (property == m_height) 124 else if (property == m_height)
125 addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyHeigh t, *m_height->currentValue()); 125 addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight, m_heig ht->currentValue()->asCSSPrimitiveValue());
126 else if (property == m_rx) 126 else if (property == m_rx)
127 addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyRx, * m_rx->currentValue()); 127 addPropertyToPresentationAttributeStyle(style, CSSPropertyRx, m_rx->curr entValue()->asCSSPrimitiveValue());
128 else if (property == m_ry) 128 else if (property == m_ry)
129 addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyRy, * m_ry->currentValue()); 129 addPropertyToPresentationAttributeStyle(style, CSSPropertyRy, m_ry->curr entValue()->asCSSPrimitiveValue());
130 else 130 else
131 SVGGeometryElement::collectStyleForPresentationAttribute(name, value, st yle); 131 SVGGeometryElement::collectStyleForPresentationAttribute(name, value, st yle);
132 } 132 }
133 133
134 void SVGRectElement::svgAttributeChanged(const QualifiedName& attrName) 134 void SVGRectElement::svgAttributeChanged(const QualifiedName& attrName)
135 { 135 {
136 if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr 136 if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr
137 || attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr 137 || attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr
138 || attrName == SVGNames::rxAttr || attrName == SVGNames::ryAttr) { 138 || attrName == SVGNames::rxAttr || attrName == SVGNames::ryAttr) {
139 SVGElement::InvalidationGuard invalidationGuard(this); 139 SVGElement::InvalidationGuard invalidationGuard(this);
(...skipping 25 matching lines...) Expand all
165 || m_rx->currentValue()->isRelative() 165 || m_rx->currentValue()->isRelative()
166 || m_ry->currentValue()->isRelative(); 166 || m_ry->currentValue()->isRelative();
167 } 167 }
168 168
169 LayoutObject* SVGRectElement::createLayoutObject(const ComputedStyle&) 169 LayoutObject* SVGRectElement::createLayoutObject(const ComputedStyle&)
170 { 170 {
171 return new LayoutSVGRect(this); 171 return new LayoutSVGRect(this);
172 } 172 }
173 173
174 } // namespace blink 174 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGMaskElement.cpp ('k') | third_party/WebKit/Source/core/svg/SVGSVGElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698