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

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

Issue 1074813002: Remove isSupportedAttribute in svg (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: invalidation guard tweaks Created 5 years, 8 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
4 * Copyright (C) 2010 Dirk Schulze <krit@webkit.org> 4 * Copyright (C) 2010 Dirk Schulze <krit@webkit.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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 } 106 }
107 } else if (target->isSVGElement()) { 107 } else if (target->isSVGElement()) {
108 // Register us with the target in the dependencies map. Any change of hr efElement 108 // Register us with the target in the dependencies map. Any change of hr efElement
109 // that leads to relayout/repainting now informs us, so we can react to it. 109 // that leads to relayout/repainting now informs us, so we can react to it.
110 addReferenceTo(toSVGElement(target)); 110 addReferenceTo(toSVGElement(target));
111 } 111 }
112 112
113 invalidate(); 113 invalidate();
114 } 114 }
115 115
116 bool SVGFEImageElement::isSupportedAttribute(const QualifiedName& attrName)
117 {
118 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
119 if (supportedAttributes.isEmpty()) {
120 SVGURIReference::addSupportedAttributes(supportedAttributes);
121 supportedAttributes.add(SVGNames::preserveAspectRatioAttr);
122 }
123 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
124 }
125
126 void SVGFEImageElement::svgAttributeChanged(const QualifiedName& attrName) 116 void SVGFEImageElement::svgAttributeChanged(const QualifiedName& attrName)
127 { 117 {
128 if (!isSupportedAttribute(attrName)) {
129 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName);
130 return;
131 }
132
133 SVGElement::InvalidationGuard invalidationGuard(this);
134
135 if (attrName == SVGNames::preserveAspectRatioAttr) { 118 if (attrName == SVGNames::preserveAspectRatioAttr) {
119 SVGElement::InvalidationGuard invalidationGuard(this);
136 invalidate(); 120 invalidate();
137 return; 121 return;
138 } 122 }
139 123
140 if (SVGURIReference::isKnownAttribute(attrName)) { 124 if (SVGURIReference::isKnownAttribute(attrName)) {
125 SVGElement::InvalidationGuard invalidationGuard(this);
141 buildPendingResource(); 126 buildPendingResource();
142 return; 127 return;
143 } 128 }
144 129
145 ASSERT_NOT_REACHED(); 130 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName);
146 } 131 }
147 132
148 Node::InsertionNotificationRequest SVGFEImageElement::insertedInto(ContainerNode * rootParent) 133 Node::InsertionNotificationRequest SVGFEImageElement::insertedInto(ContainerNode * rootParent)
149 { 134 {
150 SVGFilterPrimitiveStandardAttributes::insertedInto(rootParent); 135 SVGFilterPrimitiveStandardAttributes::insertedInto(rootParent);
151 buildPendingResource(); 136 buildPendingResource();
152 return InsertionDone; 137 return InsertionDone;
153 } 138 }
154 139
155 void SVGFEImageElement::removedFrom(ContainerNode* rootParent) 140 void SVGFEImageElement::removedFrom(ContainerNode* rootParent)
(...skipping 17 matching lines...) Expand all
173 } 158 }
174 159
175 PassRefPtrWillBeRawPtr<FilterEffect> SVGFEImageElement::build(SVGFilterBuilder*, Filter* filter) 160 PassRefPtrWillBeRawPtr<FilterEffect> SVGFEImageElement::build(SVGFilterBuilder*, Filter* filter)
176 { 161 {
177 if (m_cachedImage) 162 if (m_cachedImage)
178 return FEImage::createWithImage(filter, m_cachedImage->imageForLayoutObj ect(layoutObject()), m_preserveAspectRatio->currentValue()); 163 return FEImage::createWithImage(filter, m_cachedImage->imageForLayoutObj ect(layoutObject()), m_preserveAspectRatio->currentValue());
179 return FEImage::createWithIRIReference(filter, treeScope(), hrefString(), m_ preserveAspectRatio->currentValue()); 164 return FEImage::createWithIRIReference(filter, treeScope(), hrefString(), m_ preserveAspectRatio->currentValue());
180 } 165 }
181 166
182 } 167 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698