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

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

Issue 2549563002: Only communicate CSSPrimitiveValue references from SVGLength (Closed)
Patch Set: Created 4 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, 2008, 2009 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Rob Buis <buis@kde.org>
4 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> 4 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org>
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } 83 }
84 84
85 return true; 85 return true;
86 } 86 }
87 87
88 void SVGImageElement::collectStyleForPresentationAttribute( 88 void SVGImageElement::collectStyleForPresentationAttribute(
89 const QualifiedName& name, 89 const QualifiedName& name,
90 const AtomicString& value, 90 const AtomicString& value,
91 MutableStylePropertySet* style) { 91 MutableStylePropertySet* style) {
92 SVGAnimatedPropertyBase* property = propertyFromAttribute(name); 92 SVGAnimatedPropertyBase* property = propertyFromAttribute(name);
93 if (property == m_width) 93 if (property == m_width) {
94 addPropertyToPresentationAttributeStyle( 94 addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth,
95 style, CSSPropertyWidth, 95 m_width->cssValue());
96 m_width->currentValue()->asCSSPrimitiveValue()); 96 } else if (property == m_height) {
97 else if (property == m_height) 97 addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight,
98 addPropertyToPresentationAttributeStyle( 98 m_height->cssValue());
99 style, CSSPropertyHeight, 99 } else if (property == m_x) {
100 m_height->currentValue()->asCSSPrimitiveValue()); 100 addPropertyToPresentationAttributeStyle(style, CSSPropertyX,
101 else if (property == m_x) 101 m_x->cssValue());
102 addPropertyToPresentationAttributeStyle( 102 } else if (property == m_y) {
103 style, CSSPropertyX, m_x->currentValue()->asCSSPrimitiveValue()); 103 addPropertyToPresentationAttributeStyle(style, CSSPropertyY,
104 else if (property == m_y) 104 m_y->cssValue());
105 addPropertyToPresentationAttributeStyle( 105 } else {
106 style, CSSPropertyY, m_y->currentValue()->asCSSPrimitiveValue());
107 else
108 SVGGraphicsElement::collectStyleForPresentationAttribute(name, value, 106 SVGGraphicsElement::collectStyleForPresentationAttribute(name, value,
109 style); 107 style);
108 }
110 } 109 }
111 110
112 void SVGImageElement::svgAttributeChanged(const QualifiedName& attrName) { 111 void SVGImageElement::svgAttributeChanged(const QualifiedName& attrName) {
113 bool isLengthAttribute = 112 bool isLengthAttribute =
114 attrName == SVGNames::xAttr || attrName == SVGNames::yAttr || 113 attrName == SVGNames::xAttr || attrName == SVGNames::yAttr ||
115 attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr; 114 attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr;
116 115
117 if (isLengthAttribute || attrName == SVGNames::preserveAspectRatioAttr) { 116 if (isLengthAttribute || attrName == SVGNames::preserveAspectRatioAttr) {
118 SVGElement::InvalidationGuard invalidationGuard(this); 117 SVGElement::InvalidationGuard invalidationGuard(this);
119 118
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 const AtomicString SVGImageElement::imageSourceURL() const { 198 const AtomicString SVGImageElement::imageSourceURL() const {
200 return AtomicString(hrefString()); 199 return AtomicString(hrefString());
201 } 200 }
202 201
203 void SVGImageElement::didMoveToNewDocument(Document& oldDocument) { 202 void SVGImageElement::didMoveToNewDocument(Document& oldDocument) {
204 imageLoader().elementDidMoveToNewDocument(); 203 imageLoader().elementDidMoveToNewDocument();
205 SVGGraphicsElement::didMoveToNewDocument(oldDocument); 204 SVGGraphicsElement::didMoveToNewDocument(oldDocument);
206 } 205 }
207 206
208 } // namespace blink 207 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGForeignObjectElement.cpp ('k') | third_party/WebKit/Source/core/svg/SVGLength.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698