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

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

Issue 2708923011: Avoid duplicating the CSS property mapping for SVG pres. attrs. (Closed)
Patch Set: Created 3 years, 9 months 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 path.addRect(FloatRect(x, y, width, height)); 115 path.addRect(FloatRect(x, y, width, height));
116 return path; 116 return path;
117 } 117 }
118 118
119 void SVGRectElement::collectStyleForPresentationAttribute( 119 void SVGRectElement::collectStyleForPresentationAttribute(
120 const QualifiedName& name, 120 const QualifiedName& name,
121 const AtomicString& value, 121 const AtomicString& value,
122 MutableStylePropertySet* style) { 122 MutableStylePropertySet* style) {
123 SVGAnimatedPropertyBase* property = propertyFromAttribute(name); 123 SVGAnimatedPropertyBase* property = propertyFromAttribute(name);
124 if (property == m_x) { 124 if (property == m_x) {
125 addPropertyToPresentationAttributeStyle(style, CSSPropertyX, 125 addPropertyToPresentationAttributeStyle(style, property->cssPropertyId(),
126 m_x->cssValue()); 126 m_x->cssValue());
127 } else if (property == m_y) { 127 } else if (property == m_y) {
128 addPropertyToPresentationAttributeStyle(style, CSSPropertyY, 128 addPropertyToPresentationAttributeStyle(style, property->cssPropertyId(),
129 m_y->cssValue()); 129 m_y->cssValue());
130 } else if (property == m_width) { 130 } else if (property == m_width) {
131 addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth, 131 addPropertyToPresentationAttributeStyle(style, property->cssPropertyId(),
132 m_width->cssValue()); 132 m_width->cssValue());
133 } else if (property == m_height) { 133 } else if (property == m_height) {
134 addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight, 134 addPropertyToPresentationAttributeStyle(style, property->cssPropertyId(),
135 m_height->cssValue()); 135 m_height->cssValue());
136 } else if (property == m_rx) { 136 } else if (property == m_rx) {
137 addPropertyToPresentationAttributeStyle(style, CSSPropertyRx, 137 addPropertyToPresentationAttributeStyle(style, property->cssPropertyId(),
138 m_rx->cssValue()); 138 m_rx->cssValue());
139 } else if (property == m_ry) { 139 } else if (property == m_ry) {
140 addPropertyToPresentationAttributeStyle(style, CSSPropertyRy, 140 addPropertyToPresentationAttributeStyle(style, property->cssPropertyId(),
141 m_ry->cssValue()); 141 m_ry->cssValue());
142 } else { 142 } else {
143 SVGGeometryElement::collectStyleForPresentationAttribute(name, value, 143 SVGGeometryElement::collectStyleForPresentationAttribute(name, value,
144 style); 144 style);
145 } 145 }
146 } 146 }
147 147
148 void SVGRectElement::svgAttributeChanged(const QualifiedName& attrName) { 148 void SVGRectElement::svgAttributeChanged(const QualifiedName& attrName) {
149 if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr || 149 if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr ||
150 attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr || 150 attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr ||
(...skipping 25 matching lines...) Expand all
176 m_height->currentValue()->isRelative() || 176 m_height->currentValue()->isRelative() ||
177 m_rx->currentValue()->isRelative() || 177 m_rx->currentValue()->isRelative() ||
178 m_ry->currentValue()->isRelative(); 178 m_ry->currentValue()->isRelative();
179 } 179 }
180 180
181 LayoutObject* SVGRectElement::createLayoutObject(const ComputedStyle&) { 181 LayoutObject* SVGRectElement::createLayoutObject(const ComputedStyle&) {
182 return new LayoutSVGRect(this); 182 return new LayoutSVGRect(this);
183 } 183 }
184 184
185 } // namespace blink 185 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGPathElement.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