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

Side by Side Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.h

Issue 2722543002: Improve handling of duplicate id's for SVG resources (Closed)
Patch Set: Rebase Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 virtual LayoutSVGResourceType resourceType() const = 0; 56 virtual LayoutSVGResourceType resourceType() const = 0;
57 57
58 bool isSVGPaintServer() const { 58 bool isSVGPaintServer() const {
59 LayoutSVGResourceType resourceType = this->resourceType(); 59 LayoutSVGResourceType resourceType = this->resourceType();
60 return resourceType == PatternResourceType || 60 return resourceType == PatternResourceType ||
61 resourceType == LinearGradientResourceType || 61 resourceType == LinearGradientResourceType ||
62 resourceType == RadialGradientResourceType; 62 resourceType == RadialGradientResourceType;
63 } 63 }
64 64
65 void idChanged(const AtomicString& oldId, const AtomicString& newId); 65 void idChanged(const AtomicString& oldId, const AtomicString& newId);
66 void detachAllClients(const AtomicString& toId);
66 67
67 void invalidateCacheAndMarkForLayout(SubtreeLayoutScope* = nullptr); 68 void invalidateCacheAndMarkForLayout(SubtreeLayoutScope* = nullptr);
68 69
69 static void markForLayoutAndParentResourceInvalidation( 70 static void markForLayoutAndParentResourceInvalidation(
70 LayoutObject*, 71 LayoutObject*,
71 bool needsLayout = true); 72 bool needsLayout = true);
72 73
73 void clearInvalidationMask() { m_invalidationMask = 0; } 74 void clearInvalidationMask() { m_invalidationMask = 0; }
74 75
75 protected: 76 protected:
(...skipping 11 matching lines...) Expand all
87 void markClientForInvalidation(LayoutObject*, InvalidationMode); 88 void markClientForInvalidation(LayoutObject*, InvalidationMode);
88 89
89 void notifyContentChanged(); 90 void notifyContentChanged();
90 SVGElementProxySet* elementProxySet(); 91 SVGElementProxySet* elementProxySet();
91 92
92 void willBeDestroyed() override; 93 void willBeDestroyed() override;
93 94
94 bool m_isInLayout; 95 bool m_isInLayout;
95 96
96 private: 97 private:
98 friend class SVGTreeScopeResources;
99 // The m_registered flag is updated by SVGTreeScopeResources, and indicates
100 // that this resource is the one that is resident in the id->resource map.
101 void setRegistered(bool registered) { m_registered = registered; }
102 bool isRegistered() const { return m_registered; }
103
97 friend class SVGResourcesCache; 104 friend class SVGResourcesCache;
98 void addClient(LayoutObject*); 105 void addClient(LayoutObject*);
99 void removeClient(LayoutObject*); 106 void removeClient(LayoutObject*);
100 void detachAllClients();
101 107
102 // Track global (markAllClientsForInvalidation) invals to avoid redundant 108 // Track global (markAllClientsForInvalidation) invals to avoid redundant
103 // crawls. 109 // crawls.
104 unsigned m_invalidationMask : 8; 110 unsigned m_invalidationMask : 8;
105 111
106 unsigned m_registered : 1; 112 unsigned m_registered : 1;
107 unsigned m_isInvalidating : 1; 113 unsigned m_isInvalidating : 1;
108 // 22 padding bits available 114 // 22 padding bits available
109 115
110 HashSet<LayoutObject*> m_clients; 116 HashSet<LayoutObject*> m_clients;
(...skipping 14 matching lines...) Expand all
125 isSVGResourceContainer()); 131 isSVGResourceContainer());
126 132
127 #define DEFINE_LAYOUT_SVG_RESOURCE_TYPE_CASTS(thisType, typeName) \ 133 #define DEFINE_LAYOUT_SVG_RESOURCE_TYPE_CASTS(thisType, typeName) \
128 DEFINE_TYPE_CASTS(thisType, LayoutSVGResourceContainer, resource, \ 134 DEFINE_TYPE_CASTS(thisType, LayoutSVGResourceContainer, resource, \
129 resource->resourceType() == typeName, \ 135 resource->resourceType() == typeName, \
130 resource.resourceType() == typeName) 136 resource.resourceType() == typeName)
131 137
132 } // namespace blink 138 } // namespace blink
133 139
134 #endif 140 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698