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 clearScopedStyleResolver(); |
180 if (!root) | 180 if (m_registeredWithParentShadowRoot) { |
181 root = insertionPoint->containingShadowRoot(); | 181 ShadowRoot* root = host()->containingShadowRoot(); |
182 if (root) | 182 if (!root) |
183 root->removeChildShadowRoot(); | 183 root = insertionPoint->containingShadowRoot(); |
184 m_registeredWithParentShadowRoot = false; | 184 if (root) |
| 185 root->removeChildShadowRoot(); |
| 186 m_registeredWithParentShadowRoot = false; |
| 187 } |
185 } | 188 } |
186 | 189 |
187 DocumentFragment::removedFrom(insertionPoint); | 190 DocumentFragment::removedFrom(insertionPoint); |
188 } | 191 } |
189 | 192 |
190 void ShadowRoot::childrenChanged(const ChildrenChange& change) | 193 void ShadowRoot::childrenChanged(const ChildrenChange& change) |
191 { | 194 { |
192 ContainerNode::childrenChanged(change); | 195 ContainerNode::childrenChanged(change); |
193 | 196 |
194 if (change.isChildElementChange()) | 197 if (change.isChildElementChange()) |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 void ShadowRoot::trace(Visitor* visitor) | 322 void ShadowRoot::trace(Visitor* visitor) |
320 { | 323 { |
321 visitor->trace(m_prev); | 324 visitor->trace(m_prev); |
322 visitor->trace(m_next); | 325 visitor->trace(m_next); |
323 visitor->trace(m_shadowRootRareData); | 326 visitor->trace(m_shadowRootRareData); |
324 TreeScope::trace(visitor); | 327 TreeScope::trace(visitor); |
325 DocumentFragment::trace(visitor); | 328 DocumentFragment::trace(visitor); |
326 } | 329 } |
327 | 330 |
328 } | 331 } |
OLD | NEW |