Chromium Code Reviews| 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()); |
|
haraken
2014/05/07 12:50:20
Shall we add a FIXME to this?
Mads Ager (chromium)
2014/05/08 09:08:59
I filed a bug report to track this and will coordi
| |
| 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 |
| 182 } | 183 } |
| 184 #endif | |
| 183 | 185 |
| 184 void ElementShadow::attach(const Node::AttachContext& context) | 186 void ElementShadow::attach(const Node::AttachContext& context) |
| 185 { | 187 { |
| 186 Node::AttachContext childrenContext(context); | 188 Node::AttachContext childrenContext(context); |
| 187 childrenContext.resolvedStyle = 0; | 189 childrenContext.resolvedStyle = 0; |
| 188 | 190 |
| 189 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadow Root()) { | 191 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadow Root()) { |
| 190 if (root->needsAttach()) | 192 if (root->needsAttach()) |
| 191 root->attach(childrenContext); | 193 root->attach(childrenContext); |
| 192 } | 194 } |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 354 | 356 |
| 355 void ElementShadow::trace(Visitor* visitor) | 357 void ElementShadow::trace(Visitor* visitor) |
| 356 { | 358 { |
| 357 // Shadow roots are linked with previous and next pointers which are traced. | 359 // Shadow roots are linked with previous and next pointers which are traced. |
| 358 // It is therefore enough to trace one of the shadow roots here and the | 360 // It is therefore enough to trace one of the shadow roots here and the |
| 359 // rest will be traced from there. | 361 // rest will be traced from there. |
| 360 visitor->trace(m_shadowRoots.head()); | 362 visitor->trace(m_shadowRoots.head()); |
| 361 } | 363 } |
| 362 | 364 |
| 363 } // namespace | 365 } // namespace |
| OLD | NEW |