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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 return InsertionDone; | 170 return InsertionDone; |
171 | 171 |
172 if (ShadowRoot* root = host()->containingShadowRoot()) { | 172 if (ShadowRoot* root = host()->containingShadowRoot()) { |
173 root->addChildShadowRoot(); | 173 root->addChildShadowRoot(); |
174 m_registeredWithParentShadowRoot = true; | 174 m_registeredWithParentShadowRoot = true; |
175 } | 175 } |
176 | 176 |
177 return InsertionDone; | 177 return InsertionDone; |
178 } | 178 } |
179 | 179 |
180 void ShadowRoot::removedFrom(ContainerNode* insertionPoint) | 180 void ShadowRoot::removedFrom(ContainerNode* insertionPoint, Node* next) |
181 { | 181 { |
182 if (insertionPoint->inDocument()) { | 182 if (insertionPoint->inDocument()) { |
183 document().styleEngine().shadowRootRemovedFromDocument(this); | 183 document().styleEngine().shadowRootRemovedFromDocument(this); |
184 if (m_registeredWithParentShadowRoot) { | 184 if (m_registeredWithParentShadowRoot) { |
185 ShadowRoot* root = host()->containingShadowRoot(); | 185 ShadowRoot* root = host()->containingShadowRoot(); |
186 if (!root) | 186 if (!root) |
187 root = insertionPoint->containingShadowRoot(); | 187 root = insertionPoint->containingShadowRoot(); |
188 if (root) | 188 if (root) |
189 root->removeChildShadowRoot(); | 189 root->removeChildShadowRoot(); |
190 m_registeredWithParentShadowRoot = false; | 190 m_registeredWithParentShadowRoot = false; |
191 } | 191 } |
192 } | 192 } |
193 | 193 |
194 DocumentFragment::removedFrom(insertionPoint); | 194 DocumentFragment::removedFrom(insertionPoint, next); |
195 } | 195 } |
196 | 196 |
197 void ShadowRoot::childrenChanged(const ChildrenChange& change) | 197 void ShadowRoot::childrenChanged(const ChildrenChange& change) |
198 { | 198 { |
199 ContainerNode::childrenChanged(change); | 199 ContainerNode::childrenChanged(change); |
200 | 200 |
201 if (change.isChildElementChange()) | 201 if (change.isChildElementChange()) |
202 checkForSiblingStyleChanges(change.type == ElementRemoved ? SiblingEleme
ntRemoved : SiblingElementInserted, change.siblingBeforeChange, change.siblingAf
terChange); | 202 checkForSiblingStyleChanges(change.type == ElementRemoved ? SiblingEleme
ntRemoved : SiblingElementInserted, change.siblingBeforeChange, change.siblingAf
terChange); |
203 | 203 |
204 if (InsertionPoint* point = shadowInsertionPointOfYoungerShadowRoot()) { | 204 if (InsertionPoint* point = shadowInsertionPointOfYoungerShadowRoot()) { |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 DEFINE_TRACE(ShadowRoot) | 326 DEFINE_TRACE(ShadowRoot) |
327 { | 327 { |
328 visitor->trace(m_prev); | 328 visitor->trace(m_prev); |
329 visitor->trace(m_next); | 329 visitor->trace(m_next); |
330 visitor->trace(m_shadowRootRareData); | 330 visitor->trace(m_shadowRootRareData); |
331 TreeScope::trace(visitor); | 331 TreeScope::trace(visitor); |
332 DocumentFragment::trace(visitor); | 332 DocumentFragment::trace(visitor); |
333 } | 333 } |
334 | 334 |
335 } | 335 } |
OLD | NEW |