| Index: Source/core/dom/shadow/ElementShadow.cpp
|
| diff --git a/Source/core/dom/shadow/ElementShadow.cpp b/Source/core/dom/shadow/ElementShadow.cpp
|
| index ba11a7035476768c2f723cc0defafba3f50454b5..1cd754dc722e1fcb12caf329e571b608a06da2a7 100644
|
| --- a/Source/core/dom/shadow/ElementShadow.cpp
|
| +++ b/Source/core/dom/shadow/ElementShadow.cpp
|
| @@ -163,20 +163,28 @@ ShadowRoot& ElementShadow::addShadowRoot(Element& shadowHost, ShadowRoot::Shadow
|
|
|
| void ElementShadow::removeDetachedShadowRoots()
|
| {
|
| + // With Oilpan, the Element shadow roots may have been finalized
|
| + // during the same sweep. Do not access, but do the minimum
|
| + // necessary/allowed, just clearing the list of roots.
|
| +#if !ENABLE(OILPAN)
|
| // Dont protect this ref count.
|
| Element* shadowHost = host();
|
| ASSERT(shadowHost);
|
| +#endif
|
|
|
| while (RefPtr<ShadowRoot> oldRoot = m_shadowRoots.head()) {
|
| +#if !ENABLE(OILPAN)
|
| InspectorInstrumentation::willPopShadowRoot(shadowHost, oldRoot.get());
|
| shadowHost->document().removeFocusedElementOfSubtree(oldRoot.get());
|
| +#endif
|
| m_shadowRoots.removeHead();
|
| oldRoot->setParentOrShadowHostNode(0);
|
| +#if !ENABLE(OILPAN)
|
| oldRoot->setParentTreeScope(shadowHost->document());
|
| +#endif
|
| oldRoot->setPrev(0);
|
| oldRoot->setNext(0);
|
| }
|
| -
|
| }
|
|
|
| void ElementShadow::attach(const Node::AttachContext& context)
|
|
|