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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGForeignObjectElement.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) 2006 Apple Inc. All rights reserved. 2 * Copyright (C) 2006 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> 3 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 SVGGraphicsElement::trace(visitor); 63 SVGGraphicsElement::trace(visitor);
64 } 64 }
65 65
66 DEFINE_NODE_FACTORY(SVGForeignObjectElement) 66 DEFINE_NODE_FACTORY(SVGForeignObjectElement)
67 67
68 void SVGForeignObjectElement::collectStyleForPresentationAttribute( 68 void SVGForeignObjectElement::collectStyleForPresentationAttribute(
69 const QualifiedName& name, 69 const QualifiedName& name,
70 const AtomicString& value, 70 const AtomicString& value,
71 MutableStylePropertySet* style) { 71 MutableStylePropertySet* style) {
72 SVGAnimatedPropertyBase* property = propertyFromAttribute(name); 72 SVGAnimatedPropertyBase* property = propertyFromAttribute(name);
73 if (property == m_width) 73 if (property == m_width) {
74 addPropertyToPresentationAttributeStyle( 74 addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth,
75 style, CSSPropertyWidth, 75 m_width->cssValue());
76 m_width->currentValue()->asCSSPrimitiveValue()); 76 } else if (property == m_height) {
77 else if (property == m_height) 77 addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight,
78 addPropertyToPresentationAttributeStyle( 78 m_height->cssValue());
79 style, CSSPropertyHeight, 79 } else if (property == m_x) {
80 m_height->currentValue()->asCSSPrimitiveValue()); 80 addPropertyToPresentationAttributeStyle(style, CSSPropertyX,
81 else if (property == m_x) 81 m_x->cssValue());
82 addPropertyToPresentationAttributeStyle( 82 } else if (property == m_y) {
83 style, CSSPropertyX, m_x->currentValue()->asCSSPrimitiveValue()); 83 addPropertyToPresentationAttributeStyle(style, CSSPropertyY,
84 else if (property == m_y) 84 m_y->cssValue());
85 addPropertyToPresentationAttributeStyle( 85 } else {
86 style, CSSPropertyY, m_y->currentValue()->asCSSPrimitiveValue());
87 else
88 SVGGraphicsElement::collectStyleForPresentationAttribute(name, value, 86 SVGGraphicsElement::collectStyleForPresentationAttribute(name, value,
89 style); 87 style);
88 }
90 } 89 }
91 90
92 void SVGForeignObjectElement::svgAttributeChanged( 91 void SVGForeignObjectElement::svgAttributeChanged(
93 const QualifiedName& attrName) { 92 const QualifiedName& attrName) {
94 bool isWidthHeightAttribute = 93 bool isWidthHeightAttribute =
95 attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr; 94 attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr;
96 bool isXYAttribute = 95 bool isXYAttribute =
97 attrName == SVGNames::xAttr || attrName == SVGNames::yAttr; 96 attrName == SVGNames::xAttr || attrName == SVGNames::yAttr;
98 97
99 if (isXYAttribute || isWidthHeightAttribute) { 98 if (isXYAttribute || isWidthHeightAttribute) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 } 140 }
142 141
143 bool SVGForeignObjectElement::selfHasRelativeLengths() const { 142 bool SVGForeignObjectElement::selfHasRelativeLengths() const {
144 return m_x->currentValue()->isRelative() || 143 return m_x->currentValue()->isRelative() ||
145 m_y->currentValue()->isRelative() || 144 m_y->currentValue()->isRelative() ||
146 m_width->currentValue()->isRelative() || 145 m_width->currentValue()->isRelative() ||
147 m_height->currentValue()->isRelative(); 146 m_height->currentValue()->isRelative();
148 } 147 }
149 148
150 } // namespace blink 149 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGEllipseElement.cpp ('k') | third_party/WebKit/Source/core/svg/SVGImageElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698