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

Side by Side Diff: Source/WebCore/svg/SVGFilterElement.cpp

Issue 10442022: Merge 116647 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
Patch Set: Created 8 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
4 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> 4 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
5 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 5 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version. 11 * version 2 of the License, or (at your option) any later version.
12 * 12 *
13 * This library is distributed in the hope that it will be useful, 13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details. 16 * Library General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Library General Public License 18 * You should have received a copy of the GNU Library General Public License
19 * along with this library; see the file COPYING.LIB. If not, write to 19 * along with this library; see the file COPYING.LIB. If not, write to
20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA. 21 * Boston, MA 02110-1301, USA.
22 */ 22 */
23 23
24 #include "config.h" 24 #include "config.h"
25 25
26 #if ENABLE(SVG) && ENABLE(FILTERS) 26 #if ENABLE(SVG) && ENABLE(FILTERS)
27 #include "SVGFilterElement.h" 27 #include "SVGFilterElement.h"
28 28
29 #include "Attr.h" 29 #include "Attr.h"
30 #include "NodeRenderingContext.h"
30 #include "RenderSVGResourceFilter.h" 31 #include "RenderSVGResourceFilter.h"
31 #include "SVGElementInstance.h" 32 #include "SVGElementInstance.h"
32 #include "SVGFilterBuilder.h" 33 #include "SVGFilterBuilder.h"
33 #include "SVGFilterPrimitiveStandardAttributes.h" 34 #include "SVGFilterPrimitiveStandardAttributes.h"
34 #include "SVGNames.h" 35 #include "SVGNames.h"
35 #include "SVGParserUtilities.h" 36 #include "SVGParserUtilities.h"
36 37
37 namespace WebCore { 38 namespace WebCore {
38 39
39 // Animated property definitions 40 // Animated property definitions
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 187
187 if (RenderObject* object = renderer()) 188 if (RenderObject* object = renderer())
188 object->setNeedsLayout(true); 189 object->setNeedsLayout(true);
189 } 190 }
190 191
191 RenderObject* SVGFilterElement::createRenderer(RenderArena* arena, RenderStyle*) 192 RenderObject* SVGFilterElement::createRenderer(RenderArena* arena, RenderStyle*)
192 { 193 {
193 return new (arena) RenderSVGResourceFilter(this); 194 return new (arena) RenderSVGResourceFilter(this);
194 } 195 }
195 196
197 bool SVGFilterElement::childShouldCreateRenderer(const NodeRenderingContext& chi ldContext) const
198 {
199 if (!childContext.node()->isSVGElement())
200 return false;
201
202 Element* element = static_cast<Element*>(childContext.node());
203
204 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, allowedChildElementTags, ());
205 if (allowedChildElementTags.isEmpty()) {
206 allowedChildElementTags.add(SVGNames::feBlendTag);
207 allowedChildElementTags.add(SVGNames::feColorMatrixTag);
208 allowedChildElementTags.add(SVGNames::feComponentTransferTag);
209 allowedChildElementTags.add(SVGNames::feCompositeTag);
210 allowedChildElementTags.add(SVGNames::feConvolveMatrixTag);
211 allowedChildElementTags.add(SVGNames::feDiffuseLightingTag);
212 allowedChildElementTags.add(SVGNames::feDisplacementMapTag);
213 allowedChildElementTags.add(SVGNames::feDistantLightTag);
214 allowedChildElementTags.add(SVGNames::feDropShadowTag);
215 allowedChildElementTags.add(SVGNames::feFloodTag);
216 allowedChildElementTags.add(SVGNames::feFuncATag);
217 allowedChildElementTags.add(SVGNames::feFuncBTag);
218 allowedChildElementTags.add(SVGNames::feFuncGTag);
219 allowedChildElementTags.add(SVGNames::feFuncRTag);
220 allowedChildElementTags.add(SVGNames::feGaussianBlurTag);
221 allowedChildElementTags.add(SVGNames::feImageTag);
222 allowedChildElementTags.add(SVGNames::feMergeTag);
223 allowedChildElementTags.add(SVGNames::feMergeNodeTag);
224 allowedChildElementTags.add(SVGNames::feMorphologyTag);
225 allowedChildElementTags.add(SVGNames::feOffsetTag);
226 allowedChildElementTags.add(SVGNames::fePointLightTag);
227 allowedChildElementTags.add(SVGNames::feSpecularLightingTag);
228 allowedChildElementTags.add(SVGNames::feSpotLightTag);
229 allowedChildElementTags.add(SVGNames::feTileTag);
230 allowedChildElementTags.add(SVGNames::feTurbulenceTag);
231 }
232
233 return allowedChildElementTags.contains<QualifiedName, SVGAttributeHashTrans lator>(element->tagQName());
234 }
235
196 bool SVGFilterElement::selfHasRelativeLengths() const 236 bool SVGFilterElement::selfHasRelativeLengths() const
197 { 237 {
198 return x().isRelative() 238 return x().isRelative()
199 || y().isRelative() 239 || y().isRelative()
200 || width().isRelative() 240 || width().isRelative()
201 || height().isRelative(); 241 || height().isRelative();
202 } 242 }
203 243
204 } 244 }
205 245
206 #endif 246 #endif
OLDNEW
« no previous file with comments | « Source/WebCore/svg/SVGFilterElement.h ('k') | Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698