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

Side by Side Diff: Source/core/svg/SVGPatternElement.cpp

Issue 1006493002: [svg2] Exclude <pattern> from having x and y presentation attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
« no previous file with comments | « Source/core/svg/SVGPatternElement.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde .org> 2 * Copyright (C) 2004, 2005, 2006, 2007, 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 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 supportedAttributes.add(SVGNames::patternContentUnitsAttr); 81 supportedAttributes.add(SVGNames::patternContentUnitsAttr);
82 supportedAttributes.add(SVGNames::patternTransformAttr); 82 supportedAttributes.add(SVGNames::patternTransformAttr);
83 supportedAttributes.add(SVGNames::xAttr); 83 supportedAttributes.add(SVGNames::xAttr);
84 supportedAttributes.add(SVGNames::yAttr); 84 supportedAttributes.add(SVGNames::yAttr);
85 supportedAttributes.add(SVGNames::widthAttr); 85 supportedAttributes.add(SVGNames::widthAttr);
86 supportedAttributes.add(SVGNames::heightAttr); 86 supportedAttributes.add(SVGNames::heightAttr);
87 } 87 }
88 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); 88 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
89 } 89 }
90 90
91 bool SVGPatternElement::isPresentationAttribute(const QualifiedName& attrName) c onst
92 {
93 if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr)
94 return true;
95 return SVGElement::isPresentationAttribute(attrName);
96 }
97
98 bool SVGPatternElement::isPresentationAttributeWithSVGDOM(const QualifiedName& a ttrName) const
99 {
100 if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr)
101 return true;
102 return SVGElement::isPresentationAttributeWithSVGDOM(attrName);
103 }
104
105 void SVGPatternElement::collectStyleForPresentationAttribute(const QualifiedName & name, const AtomicString& value, MutableStylePropertySet* style)
106 {
107 RefPtrWillBeRawPtr<SVGAnimatedPropertyBase> property = propertyFromAttribute (name);
108 if (property == m_x)
109 addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyX, *m _x->currentValue());
110 else if (property == m_y)
111 addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyY, *m _y->currentValue());
112 else
113 SVGElement::collectStyleForPresentationAttribute(name, value, style);
114 }
115
116 void SVGPatternElement::parseAttribute(const QualifiedName& name, const AtomicSt ring& value) 91 void SVGPatternElement::parseAttribute(const QualifiedName& name, const AtomicSt ring& value)
117 { 92 {
118 parseAttributeNew(name, value); 93 parseAttributeNew(name, value);
119 } 94 }
120 95
121 void SVGPatternElement::svgAttributeChanged(const QualifiedName& attrName) 96 void SVGPatternElement::svgAttributeChanged(const QualifiedName& attrName)
122 { 97 {
123 if (!isSupportedAttribute(attrName)) { 98 if (!isSupportedAttribute(attrName)) {
124 SVGElement::svgAttributeChanged(attrName); 99 SVGElement::svgAttributeChanged(attrName);
125 return; 100 return;
126 } 101 }
127 102
128 SVGElement::InvalidationGuard invalidationGuard(this); 103 SVGElement::InvalidationGuard invalidationGuard(this);
129 104
130 if (attrName == SVGNames::xAttr 105 if (attrName == SVGNames::xAttr
131 || attrName == SVGNames::yAttr) { 106 || attrName == SVGNames::yAttr
132 invalidateSVGPresentationAttributeStyle(); 107 || attrName == SVGNames::widthAttr
133 setNeedsStyleRecalc(LocalStyleChange, 108 || attrName == SVGNames::heightAttr) {
134 StyleChangeReasonForTracing::fromAttribute(attrName)); 109 updateRelativeLengthsInformation();
fs 2015/03/12 16:31:39 Nit: This block is now duplicated. One should be e
Erik Dahlström (inactive) 2015/03/13 09:04:33 Ehrm, not sure how I missed that :)
135 } 110 }
136 111
137 if (attrName == SVGNames::xAttr 112 if (attrName == SVGNames::xAttr
138 || attrName == SVGNames::yAttr 113 || attrName == SVGNames::yAttr
139 || attrName == SVGNames::widthAttr 114 || attrName == SVGNames::widthAttr
140 || attrName == SVGNames::heightAttr) 115 || attrName == SVGNames::heightAttr)
141 updateRelativeLengthsInformation(); 116 updateRelativeLengthsInformation();
142 117
143 LayoutSVGResourceContainer* renderer = toLayoutSVGResourceContainer(this->la youtObject()); 118 LayoutSVGResourceContainer* renderer = toLayoutSVGResourceContainer(this->la youtObject());
144 if (renderer) 119 if (renderer)
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 206
232 bool SVGPatternElement::selfHasRelativeLengths() const 207 bool SVGPatternElement::selfHasRelativeLengths() const
233 { 208 {
234 return m_x->currentValue()->isRelative() 209 return m_x->currentValue()->isRelative()
235 || m_y->currentValue()->isRelative() 210 || m_y->currentValue()->isRelative()
236 || m_width->currentValue()->isRelative() 211 || m_width->currentValue()->isRelative()
237 || m_height->currentValue()->isRelative(); 212 || m_height->currentValue()->isRelative();
238 } 213 }
239 214
240 } // namespace blink 215 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/svg/SVGPatternElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698