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/SVGSVGElement.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 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Rob Buis <buis@kde.org>
4 * Copyright (C) 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2007 Apple Inc. All rights reserved.
5 * Copyright (C) 2014 Google, Inc. 5 * Copyright (C) 2014 Google, Inc.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 { 242 {
243 if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr) 243 if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr)
244 return true; 244 return true;
245 return SVGGraphicsElement::isPresentationAttributeWithSVGDOM(attrName); 245 return SVGGraphicsElement::isPresentationAttributeWithSVGDOM(attrName);
246 } 246 }
247 247
248 void SVGSVGElement::collectStyleForPresentationAttribute(const QualifiedName& na me, const AtomicString& value, MutableStylePropertySet* style) 248 void SVGSVGElement::collectStyleForPresentationAttribute(const QualifiedName& na me, const AtomicString& value, MutableStylePropertySet* style)
249 { 249 {
250 RefPtrWillBeRawPtr<SVGAnimatedPropertyBase> property = propertyFromAttribute (name); 250 RefPtrWillBeRawPtr<SVGAnimatedPropertyBase> property = propertyFromAttribute (name);
251 if (property == m_x) { 251 if (property == m_x) {
252 addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyX, *m _x->currentValue()); 252 addPropertyToPresentationAttributeStyle(style, CSSPropertyX, m_x->curren tValue()->asCSSPrimitiveValue());
253 } else if (property == m_y) { 253 } else if (property == m_y) {
254 addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyY, *m _y->currentValue()); 254 addPropertyToPresentationAttributeStyle(style, CSSPropertyY, m_y->curren tValue()->asCSSPrimitiveValue());
255 } else if (isOutermostSVGSVGElement() && (property == m_width || property == m_height)) { 255 } else if (isOutermostSVGSVGElement() && (property == m_width || property == m_height)) {
256 if (property == m_width) 256 if (property == m_width)
257 addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyW idth, *m_width->currentValue()); 257 addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth, m_w idth->currentValue()->asCSSPrimitiveValue());
258 else if (property == m_height) 258 else if (property == m_height)
259 addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyH eight, *m_height->currentValue()); 259 addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight, m_ height->currentValue()->asCSSPrimitiveValue());
260 } else { 260 } else {
261 SVGGraphicsElement::collectStyleForPresentationAttribute(name, value, st yle); 261 SVGGraphicsElement::collectStyleForPresentationAttribute(name, value, st yle);
262 } 262 }
263 } 263 }
264 264
265 void SVGSVGElement::svgAttributeChanged(const QualifiedName& attrName) 265 void SVGSVGElement::svgAttributeChanged(const QualifiedName& attrName)
266 { 266 {
267 bool updateRelativeLengthsOrViewBox = false; 267 bool updateRelativeLengthsOrViewBox = false;
268 bool widthChanged = attrName == SVGNames::widthAttr; 268 bool widthChanged = attrName == SVGNames::widthAttr;
269 bool heightChanged = attrName == SVGNames::heightAttr; 269 bool heightChanged = attrName == SVGNames::heightAttr;
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 visitor->trace(m_width); 769 visitor->trace(m_width);
770 visitor->trace(m_height); 770 visitor->trace(m_height);
771 visitor->trace(m_translation); 771 visitor->trace(m_translation);
772 visitor->trace(m_timeContainer); 772 visitor->trace(m_timeContainer);
773 visitor->trace(m_viewSpec); 773 visitor->trace(m_viewSpec);
774 SVGGraphicsElement::trace(visitor); 774 SVGGraphicsElement::trace(visitor);
775 SVGFitToViewBox::trace(visitor); 775 SVGFitToViewBox::trace(visitor);
776 } 776 }
777 777
778 } // namespace blink 778 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGRectElement.cpp ('k') | third_party/WebKit/Source/core/svg/SVGUseElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698