OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 ChildNodeInsertionNotifier(shadowHost).notify(*shadowRoot); | 156 ChildNodeInsertionNotifier(shadowHost).notify(*shadowRoot); |
157 setNeedsDistributionRecalc(); | 157 setNeedsDistributionRecalc(); |
158 | 158 |
159 InspectorInstrumentation::didPushShadowRoot(&shadowHost, shadowRoot.get()); | 159 InspectorInstrumentation::didPushShadowRoot(&shadowHost, shadowRoot.get()); |
160 | 160 |
161 ASSERT(m_shadowRoots.head()); | 161 ASSERT(m_shadowRoots.head()); |
162 ASSERT(shadowRoot.get() == m_shadowRoots.head()); | 162 ASSERT(shadowRoot.get() == m_shadowRoots.head()); |
163 return *m_shadowRoots.head(); | 163 return *m_shadowRoots.head(); |
164 } | 164 } |
165 | 165 |
| 166 #if !ENABLE(OILPAN) |
166 void ElementShadow::removeDetachedShadowRoots() | 167 void ElementShadow::removeDetachedShadowRoots() |
167 { | 168 { |
168 // Dont protect this ref count. | 169 // Dont protect this ref count. |
169 Element* shadowHost = host(); | 170 Element* shadowHost = host(); |
170 ASSERT(shadowHost); | 171 ASSERT(shadowHost); |
171 | 172 |
172 while (RefPtr<ShadowRoot> oldRoot = m_shadowRoots.head()) { | 173 while (RefPtr<ShadowRoot> oldRoot = m_shadowRoots.head()) { |
173 InspectorInstrumentation::willPopShadowRoot(shadowHost, oldRoot.get()); | 174 InspectorInstrumentation::willPopShadowRoot(shadowHost, oldRoot.get()); |
174 shadowHost->document().removeFocusedElementOfSubtree(oldRoot.get()); | 175 shadowHost->document().removeFocusedElementOfSubtree(oldRoot.get()); |
175 m_shadowRoots.removeHead(); | 176 m_shadowRoots.removeHead(); |
176 oldRoot->setParentOrShadowHostNode(0); | 177 oldRoot->setParentOrShadowHostNode(0); |
177 oldRoot->setParentTreeScope(shadowHost->document()); | 178 oldRoot->setParentTreeScope(shadowHost->document()); |
178 oldRoot->setPrev(0); | 179 oldRoot->setPrev(0); |
179 oldRoot->setNext(0); | 180 oldRoot->setNext(0); |
180 } | 181 } |
181 } | 182 } |
| 183 #endif |
182 | 184 |
183 void ElementShadow::attach(const Node::AttachContext& context) | 185 void ElementShadow::attach(const Node::AttachContext& context) |
184 { | 186 { |
185 Node::AttachContext childrenContext(context); | 187 Node::AttachContext childrenContext(context); |
186 childrenContext.resolvedStyle = 0; | 188 childrenContext.resolvedStyle = 0; |
187 | 189 |
188 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadow
Root()) { | 190 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadow
Root()) { |
189 if (root->needsAttach()) | 191 if (root->needsAttach()) |
190 root->attach(childrenContext); | 192 root->attach(childrenContext); |
191 } | 193 } |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 | 355 |
354 void ElementShadow::trace(Visitor* visitor) | 356 void ElementShadow::trace(Visitor* visitor) |
355 { | 357 { |
356 // Shadow roots are linked with previous and next pointers which are traced. | 358 // Shadow roots are linked with previous and next pointers which are traced. |
357 // It is therefore enough to trace one of the shadow roots here and the | 359 // It is therefore enough to trace one of the shadow roots here and the |
358 // rest will be traced from there. | 360 // rest will be traced from there. |
359 visitor->trace(m_shadowRoots.head()); | 361 visitor->trace(m_shadowRoots.head()); |
360 } | 362 } |
361 | 363 |
362 } // namespace | 364 } // namespace |
OLD | NEW |