| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 if (ShadowRoot* root = host()->containingShadowRoot()) { | 168 if (ShadowRoot* root = host()->containingShadowRoot()) { |
| 169 root->addChildShadowRoot(); | 169 root->addChildShadowRoot(); |
| 170 m_registeredWithParentShadowRoot = true; | 170 m_registeredWithParentShadowRoot = true; |
| 171 } | 171 } |
| 172 | 172 |
| 173 return InsertionDone; | 173 return InsertionDone; |
| 174 } | 174 } |
| 175 | 175 |
| 176 void ShadowRoot::removedFrom(ContainerNode* insertionPoint) | 176 void ShadowRoot::removedFrom(ContainerNode* insertionPoint) |
| 177 { | 177 { |
| 178 if (insertionPoint->inDocument() && m_registeredWithParentShadowRoot) { | 178 if (insertionPoint->inDocument()) { |
| 179 ShadowRoot* root = host()->containingShadowRoot(); | 179 if (ScopedStyleResolver* resolver = scopedStyleResolver()) |
| 180 if (!root) | 180 insertionPoint->document().styleEngine()->removeScopedStyleResolver(
resolver); |
| 181 root = insertionPoint->containingShadowRoot(); | 181 |
| 182 if (root) | 182 if (m_registeredWithParentShadowRoot) { |
| 183 root->removeChildShadowRoot(); | 183 ShadowRoot* root = host()->containingShadowRoot(); |
| 184 m_registeredWithParentShadowRoot = false; | 184 if (!root) |
| 185 root = insertionPoint->containingShadowRoot(); |
| 186 if (root) |
| 187 root->removeChildShadowRoot(); |
| 188 m_registeredWithParentShadowRoot = false; |
| 189 } |
| 185 } | 190 } |
| 186 | 191 |
| 187 DocumentFragment::removedFrom(insertionPoint); | 192 DocumentFragment::removedFrom(insertionPoint); |
| 188 } | 193 } |
| 189 | 194 |
| 190 void ShadowRoot::childrenChanged(const ChildrenChange& change) | 195 void ShadowRoot::childrenChanged(const ChildrenChange& change) |
| 191 { | 196 { |
| 192 ContainerNode::childrenChanged(change); | 197 ContainerNode::childrenChanged(change); |
| 193 | 198 |
| 194 if (change.isChildElementChange()) | 199 if (change.isChildElementChange()) |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 void ShadowRoot::trace(Visitor* visitor) | 324 void ShadowRoot::trace(Visitor* visitor) |
| 320 { | 325 { |
| 321 visitor->trace(m_prev); | 326 visitor->trace(m_prev); |
| 322 visitor->trace(m_next); | 327 visitor->trace(m_next); |
| 323 visitor->trace(m_shadowRootRareData); | 328 visitor->trace(m_shadowRootRareData); |
| 324 TreeScope::trace(visitor); | 329 TreeScope::trace(visitor); |
| 325 DocumentFragment::trace(visitor); | 330 DocumentFragment::trace(visitor); |
| 326 } | 331 } |
| 327 | 332 |
| 328 } | 333 } |
| OLD | NEW |