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

Side by Side Diff: Source/core/svg/SVGElement.h

Issue 64683006: [svg] TearOffs dynamically hold on to the current contextElement(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: gchack Created 7 years, 1 month 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, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006, 2008 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 Apple Inc. All rights reserved. 4 * Copyright (C) 2009 Apple Inc. 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 132
133 virtual bool haveLoadedRequiredResources(); 133 virtual bool haveLoadedRequiredResources();
134 134
135 virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<Even tListener>, bool useCapture) OVERRIDE; 135 virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<Even tListener>, bool useCapture) OVERRIDE;
136 virtual bool removeEventListener(const AtomicString& eventType, EventListene r*, bool useCapture) OVERRIDE; 136 virtual bool removeEventListener(const AtomicString& eventType, EventListene r*, bool useCapture) OVERRIDE;
137 137
138 virtual bool shouldMoveToFlowThread(RenderStyle*) const OVERRIDE; 138 virtual bool shouldMoveToFlowThread(RenderStyle*) const OVERRIDE;
139 139
140 void invalidateRelativeLengthClients(SubtreeLayoutScope* = 0); 140 void invalidateRelativeLengthClients(SubtreeLayoutScope* = 0);
141 141
142 bool isContextElement() const { return m_isContextElement; }
143 void setContextElement() { m_isContextElement = true; }
144
142 protected: 145 protected:
143 SVGElement(const QualifiedName&, Document&, ConstructionType = CreateSVGElem ent); 146 SVGElement(const QualifiedName&, Document&, ConstructionType = CreateSVGElem ent);
144 147
145 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR IDE; 148 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR IDE;
146 149
147 virtual void finishParsingChildren(); 150 virtual void finishParsingChildren();
148 virtual void attributeChanged(const QualifiedName&, const AtomicString&, Att ributeModificationReason = ModifiedDirectly) OVERRIDE; 151 virtual void attributeChanged(const QualifiedName&, const AtomicString&, Att ributeModificationReason = ModifiedDirectly) OVERRIDE;
149 virtual bool childShouldCreateRenderer(const Node& child) const OVERRIDE; 152 virtual bool childShouldCreateRenderer(const Node& child) const OVERRIDE;
150 153
151 virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE; 154 virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 HashSet<SVGElement*> m_elementsWithRelativeLengths; 213 HashSet<SVGElement*> m_elementsWithRelativeLengths;
211 214
212 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGElement) 215 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGElement)
213 DECLARE_ANIMATED_STRING(ClassName, className) 216 DECLARE_ANIMATED_STRING(ClassName, className)
214 END_DECLARE_ANIMATED_PROPERTIES 217 END_DECLARE_ANIMATED_PROPERTIES
215 218
216 #if !ASSERT_DISABLED 219 #if !ASSERT_DISABLED
217 bool m_inRelativeLengthClientsInvalidation; 220 bool m_inRelativeLengthClientsInvalidation;
218 #endif 221 #endif
219 bool m_animatedPropertiesDestructed; 222 bool m_animatedPropertiesDestructed;
223 bool m_isContextElement;
220 }; 224 };
221 225
222 struct SVGAttributeHashTranslator { 226 struct SVGAttributeHashTranslator {
223 static unsigned hash(const QualifiedName& key) 227 static unsigned hash(const QualifiedName& key)
224 { 228 {
225 if (key.hasPrefix()) { 229 if (key.hasPrefix()) {
226 QualifiedNameComponents components = { nullAtom.impl(), key.localNam e().impl(), key.namespaceURI().impl() }; 230 QualifiedNameComponents components = { nullAtom.impl(), key.localNam e().impl(), key.namespaceURI().impl() };
227 return hashComponents(components); 231 return hashComponents(components);
228 } 232 }
229 return DefaultHash<QualifiedName>::Hash::hash(key); 233 return DefaultHash<QualifiedName>::Hash::hash(key);
230 } 234 }
231 static bool equal(const QualifiedName& a, const QualifiedName& b) { return a .matches(b); } 235 static bool equal(const QualifiedName& a, const QualifiedName& b) { return a .matches(b); }
232 }; 236 };
233 237
234 DEFINE_NODE_TYPE_CASTS(SVGElement, isSVGElement()); 238 DEFINE_NODE_TYPE_CASTS(SVGElement, isSVGElement());
235 239
236 } 240 }
237 241
238 #endif 242 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698