OLD | NEW |
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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 107 |
108 HashSet<LayoutObject*> m_clients; | 108 HashSet<LayoutObject*> m_clients; |
109 PersistentHeapHashSet<WeakMember<SVGResourceClient>> m_resourceClients; | 109 PersistentHeapHashSet<WeakMember<SVGResourceClient>> m_resourceClients; |
110 }; | 110 }; |
111 | 111 |
112 inline LayoutSVGResourceContainer* getLayoutSVGResourceContainerById(TreeScope&
treeScope, const AtomicString& id) | 112 inline LayoutSVGResourceContainer* getLayoutSVGResourceContainerById(TreeScope&
treeScope, const AtomicString& id) |
113 { | 113 { |
114 if (id.isEmpty()) | 114 if (id.isEmpty()) |
115 return nullptr; | 115 return nullptr; |
116 | 116 |
117 if (LayoutSVGResourceContainer* layoutResource = treeScope.document().access
SVGExtensions().resourceById(id)) | 117 if (LayoutSVGResourceContainer* layoutResource = treeScope.accessSVGTreeScop
edResources().resourceById(id)) |
118 return layoutResource; | 118 return layoutResource; |
119 | 119 |
120 return nullptr; | 120 return nullptr; |
121 } | 121 } |
122 | 122 |
123 template<typename Layout> | 123 template<typename Layout> |
124 Layout* getLayoutSVGResourceById(TreeScope& treeScope, const AtomicString& id) | 124 Layout* getLayoutSVGResourceById(TreeScope& treeScope, const AtomicString& id) |
125 { | 125 { |
126 if (LayoutSVGResourceContainer* container = getLayoutSVGResourceContainerByI
d(treeScope, id)) { | 126 if (LayoutSVGResourceContainer* container = getLayoutSVGResourceContainerByI
d(treeScope, id)) { |
127 if (container->resourceType() == Layout::s_resourceType) | 127 if (container->resourceType() == Layout::s_resourceType) |
128 return static_cast<Layout*>(container); | 128 return static_cast<Layout*>(container); |
129 } | 129 } |
130 return nullptr; | 130 return nullptr; |
131 } | 131 } |
132 | 132 |
133 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutSVGResourceContainer, isSVGResourceContain
er()); | 133 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutSVGResourceContainer, isSVGResourceContain
er()); |
134 | 134 |
135 #define DEFINE_LAYOUT_SVG_RESOURCE_TYPE_CASTS(thisType, typeName) \ | 135 #define DEFINE_LAYOUT_SVG_RESOURCE_TYPE_CASTS(thisType, typeName) \ |
136 DEFINE_TYPE_CASTS(thisType, LayoutSVGResourceContainer, resource, resource->
resourceType() == typeName, resource.resourceType() == typeName) | 136 DEFINE_TYPE_CASTS(thisType, LayoutSVGResourceContainer, resource, resource->
resourceType() == typeName, resource.resourceType() == typeName) |
137 | 137 |
138 } // namespace blink | 138 } // namespace blink |
139 | 139 |
140 #endif | 140 #endif |
OLD | NEW |