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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGEllipseElement.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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 89
90 return path; 90 return path;
91 } 91 }
92 92
93 void SVGEllipseElement::collectStyleForPresentationAttribute( 93 void SVGEllipseElement::collectStyleForPresentationAttribute(
94 const QualifiedName& name, 94 const QualifiedName& name,
95 const AtomicString& value, 95 const AtomicString& value,
96 MutableStylePropertySet* style) { 96 MutableStylePropertySet* style) {
97 SVGAnimatedPropertyBase* property = propertyFromAttribute(name); 97 SVGAnimatedPropertyBase* property = propertyFromAttribute(name);
98 if (property == m_cx) { 98 if (property == m_cx) {
99 addPropertyToPresentationAttributeStyle(style, CSSPropertyCx, 99 addPropertyToPresentationAttributeStyle(style, property->cssPropertyId(),
100 m_cx->cssValue()); 100 m_cx->cssValue());
101 } else if (property == m_cy) { 101 } else if (property == m_cy) {
102 addPropertyToPresentationAttributeStyle(style, CSSPropertyCy, 102 addPropertyToPresentationAttributeStyle(style, property->cssPropertyId(),
103 m_cy->cssValue()); 103 m_cy->cssValue());
104 } else if (property == m_rx) { 104 } else if (property == m_rx) {
105 addPropertyToPresentationAttributeStyle(style, CSSPropertyRx, 105 addPropertyToPresentationAttributeStyle(style, property->cssPropertyId(),
106 m_rx->cssValue()); 106 m_rx->cssValue());
107 } else if (property == m_ry) { 107 } else if (property == m_ry) {
108 addPropertyToPresentationAttributeStyle(style, CSSPropertyRy, 108 addPropertyToPresentationAttributeStyle(style, property->cssPropertyId(),
109 m_ry->cssValue()); 109 m_ry->cssValue());
110 } else { 110 } else {
111 SVGGeometryElement::collectStyleForPresentationAttribute(name, value, 111 SVGGeometryElement::collectStyleForPresentationAttribute(name, value,
112 style); 112 style);
113 } 113 }
114 } 114 }
115 115
116 void SVGEllipseElement::svgAttributeChanged(const QualifiedName& attrName) { 116 void SVGEllipseElement::svgAttributeChanged(const QualifiedName& attrName) {
117 if (attrName == SVGNames::cxAttr || attrName == SVGNames::cyAttr || 117 if (attrName == SVGNames::cxAttr || attrName == SVGNames::cyAttr ||
118 attrName == SVGNames::rxAttr || attrName == SVGNames::ryAttr) { 118 attrName == SVGNames::rxAttr || attrName == SVGNames::ryAttr) {
(...skipping 21 matching lines...) Expand all
140 m_cy->currentValue()->isRelative() || 140 m_cy->currentValue()->isRelative() ||
141 m_rx->currentValue()->isRelative() || 141 m_rx->currentValue()->isRelative() ||
142 m_ry->currentValue()->isRelative(); 142 m_ry->currentValue()->isRelative();
143 } 143 }
144 144
145 LayoutObject* SVGEllipseElement::createLayoutObject(const ComputedStyle&) { 145 LayoutObject* SVGEllipseElement::createLayoutObject(const ComputedStyle&) {
146 return new LayoutSVGEllipse(this); 146 return new LayoutSVGEllipse(this);
147 } 147 }
148 148
149 } // namespace blink 149 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698