OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2011 Google Inc. All Rights Reserved. |
3 * Copyright (C) 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2012 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 Element* TreeScope::getElementById(const AtomicString& elementId) const { | 116 Element* TreeScope::getElementById(const AtomicString& elementId) const { |
117 if (elementId.isEmpty()) | 117 if (elementId.isEmpty()) |
118 return nullptr; | 118 return nullptr; |
119 if (!m_elementsById) | 119 if (!m_elementsById) |
120 return nullptr; | 120 return nullptr; |
121 return m_elementsById->getElementById(elementId, this); | 121 return m_elementsById->getElementById(elementId, this); |
122 } | 122 } |
123 | 123 |
124 const HeapVector<Member<Element>>& TreeScope::getAllElementsById( | 124 const HeapVector<Member<Element>>& TreeScope::getAllElementsById( |
125 const AtomicString& elementId) const { | 125 const AtomicString& elementId) const { |
| 126 ALLOW_UNSAFE_SINGLETON() |
126 DEFINE_STATIC_LOCAL(HeapVector<Member<Element>>, emptyVector, | 127 DEFINE_STATIC_LOCAL(HeapVector<Member<Element>>, emptyVector, |
127 (new HeapVector<Member<Element>>)); | 128 (new HeapVector<Member<Element>>)); |
128 if (elementId.isEmpty()) | 129 if (elementId.isEmpty()) |
129 return emptyVector; | 130 return emptyVector; |
130 if (!m_elementsById) | 131 if (!m_elementsById) |
131 return emptyVector; | 132 return emptyVector; |
132 return m_elementsById->getAllElementsById(elementId, this); | 133 return m_elementsById->getAllElementsById(elementId, this); |
133 } | 134 } |
134 | 135 |
135 void TreeScope::addElementById(const AtomicString& elementId, | 136 void TreeScope::addElementById(const AtomicString& elementId, |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 visitor->trace(m_idTargetObserverRegistry); | 530 visitor->trace(m_idTargetObserverRegistry); |
530 visitor->trace(m_selection); | 531 visitor->trace(m_selection); |
531 visitor->trace(m_elementsById); | 532 visitor->trace(m_elementsById); |
532 visitor->trace(m_imageMapsByName); | 533 visitor->trace(m_imageMapsByName); |
533 visitor->trace(m_scopedStyleResolver); | 534 visitor->trace(m_scopedStyleResolver); |
534 visitor->trace(m_radioButtonGroupScope); | 535 visitor->trace(m_radioButtonGroupScope); |
535 visitor->trace(m_svgTreeScopedResources); | 536 visitor->trace(m_svgTreeScopedResources); |
536 } | 537 } |
537 | 538 |
538 } // namespace blink | 539 } // namespace blink |
OLD | NEW |