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

Side by Side Diff: Source/core/svg/SVGFilterPrimitiveStandardAttributes.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, 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) 2009 Dirk Schulze <krit@webkit.org> 4 * Copyright (C) 2009 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 DEFINE_TRACE(SVGFilterPrimitiveStandardAttributes) 56 DEFINE_TRACE(SVGFilterPrimitiveStandardAttributes)
57 { 57 {
58 visitor->trace(m_x); 58 visitor->trace(m_x);
59 visitor->trace(m_y); 59 visitor->trace(m_y);
60 visitor->trace(m_width); 60 visitor->trace(m_width);
61 visitor->trace(m_height); 61 visitor->trace(m_height);
62 visitor->trace(m_result); 62 visitor->trace(m_result);
63 SVGElement::trace(visitor); 63 SVGElement::trace(visitor);
64 } 64 }
65 65
66 bool SVGFilterPrimitiveStandardAttributes::isSupportedAttribute(const QualifiedN ame& attrName)
67 {
68 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
69 if (supportedAttributes.isEmpty()) {
70 supportedAttributes.add(SVGNames::xAttr);
71 supportedAttributes.add(SVGNames::yAttr);
72 supportedAttributes.add(SVGNames::widthAttr);
73 supportedAttributes.add(SVGNames::heightAttr);
74 supportedAttributes.add(SVGNames::resultAttr);
75 }
76 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
77 }
78
79 bool SVGFilterPrimitiveStandardAttributes::setFilterEffectAttribute(FilterEffect *, const QualifiedName&) 66 bool SVGFilterPrimitiveStandardAttributes::setFilterEffectAttribute(FilterEffect *, const QualifiedName&)
80 { 67 {
81 // When all filters support this method, it will be changed to a pure virtua l method. 68 // When all filters support this method, it will be changed to a pure virtua l method.
82 ASSERT_NOT_REACHED(); 69 ASSERT_NOT_REACHED();
83 return false; 70 return false;
84 } 71 }
85 72
86 void SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(const QualifiedNa me& attrName) 73 void SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(const QualifiedNa me& attrName)
87 { 74 {
88 if (!isSupportedAttribute(attrName)) { 75 if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr
89 SVGElement::svgAttributeChanged(attrName); 76 || attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr
77 || attrName == SVGNames::resultAttr) {
78 SVGElement::InvalidationGuard invalidationGuard(this);
79 invalidate();
90 return; 80 return;
91 } 81 }
92 82
93 SVGElement::InvalidationGuard invalidationGuard(this); 83 SVGElement::svgAttributeChanged(attrName);
94 invalidate();
95 } 84 }
96 85
97 void SVGFilterPrimitiveStandardAttributes::childrenChanged(const ChildrenChange& change) 86 void SVGFilterPrimitiveStandardAttributes::childrenChanged(const ChildrenChange& change)
98 { 87 {
99 SVGElement::childrenChanged(change); 88 SVGElement::childrenChanged(change);
100 89
101 if (!change.byParser) 90 if (!change.byParser)
102 invalidate(); 91 invalidate();
103 } 92 }
104 93
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 return; 143 return;
155 144
156 LayoutObject* renderer = parent->layoutObject(); 145 LayoutObject* renderer = parent->layoutObject();
157 if (!renderer || !renderer->isSVGResourceFilterPrimitive()) 146 if (!renderer || !renderer->isSVGResourceFilterPrimitive())
158 return; 147 return;
159 148
160 LayoutSVGResourceContainer::markForLayoutAndParentResourceInvalidation(rende rer, false); 149 LayoutSVGResourceContainer::markForLayoutAndParentResourceInvalidation(rende rer, false);
161 } 150 }
162 151
163 } 152 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698