| 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 { | 154 { |
| 155 if (context.clearInvalidation) | 155 if (context.clearInvalidation) |
| 156 document().styleEngine().styleInvalidator().clearInvalidation(*this); | 156 document().styleEngine().styleInvalidator().clearInvalidation(*this); |
| 157 DocumentFragment::detach(context); | 157 DocumentFragment::detach(context); |
| 158 } | 158 } |
| 159 | 159 |
| 160 Node::InsertionNotificationRequest ShadowRoot::insertedInto(ContainerNode* inser
tionPoint) | 160 Node::InsertionNotificationRequest ShadowRoot::insertedInto(ContainerNode* inser
tionPoint) |
| 161 { | 161 { |
| 162 DocumentFragment::insertedInto(insertionPoint); | 162 DocumentFragment::insertedInto(insertionPoint); |
| 163 | 163 |
| 164 if (!insertionPoint->inShadowIncludingDocument() || !isOldest()) | 164 if (!insertionPoint->isConnected() || !isOldest()) |
| 165 return InsertionDone; | 165 return InsertionDone; |
| 166 | 166 |
| 167 // FIXME: When parsing <video controls>, insertedInto() is called many times
without invoking removedFrom. | 167 // FIXME: When parsing <video controls>, insertedInto() is called many times
without invoking removedFrom. |
| 168 // For now, we check m_registeredWithParentShadowroot. We would like to DCHE
CK(!m_registeredShadowRoot) here. | 168 // For now, we check m_registeredWithParentShadowroot. We would like to DCHE
CK(!m_registeredShadowRoot) here. |
| 169 // https://bugs.webkit.org/show_bug.cig?id=101316 | 169 // https://bugs.webkit.org/show_bug.cig?id=101316 |
| 170 if (m_registeredWithParentShadowRoot) | 170 if (m_registeredWithParentShadowRoot) |
| 171 return InsertionDone; | 171 return InsertionDone; |
| 172 | 172 |
| 173 if (ShadowRoot* root = host().containingShadowRoot()) { | 173 if (ShadowRoot* root = host().containingShadowRoot()) { |
| 174 root->addChildShadowRoot(); | 174 root->addChildShadowRoot(); |
| 175 m_registeredWithParentShadowRoot = true; | 175 m_registeredWithParentShadowRoot = true; |
| 176 } | 176 } |
| 177 | 177 |
| 178 return InsertionDone; | 178 return InsertionDone; |
| 179 } | 179 } |
| 180 | 180 |
| 181 void ShadowRoot::removedFrom(ContainerNode* insertionPoint) | 181 void ShadowRoot::removedFrom(ContainerNode* insertionPoint) |
| 182 { | 182 { |
| 183 if (insertionPoint->inShadowIncludingDocument()) { | 183 if (insertionPoint->isConnected()) { |
| 184 document().styleEngine().shadowRootRemovedFromDocument(this); | 184 document().styleEngine().shadowRootRemovedFromDocument(this); |
| 185 if (m_registeredWithParentShadowRoot) { | 185 if (m_registeredWithParentShadowRoot) { |
| 186 ShadowRoot* root = host().containingShadowRoot(); | 186 ShadowRoot* root = host().containingShadowRoot(); |
| 187 if (!root) | 187 if (!root) |
| 188 root = insertionPoint->containingShadowRoot(); | 188 root = insertionPoint->containingShadowRoot(); |
| 189 if (root) | 189 if (root) |
| 190 root->removeChildShadowRoot(); | 190 root->removeChildShadowRoot(); |
| 191 m_registeredWithParentShadowRoot = false; | 191 m_registeredWithParentShadowRoot = false; |
| 192 } | 192 } |
| 193 if (needsStyleInvalidation()) | 193 if (needsStyleInvalidation()) |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 ostream << "ShadowRootType::Open"; | 335 ostream << "ShadowRootType::Open"; |
| 336 break; | 336 break; |
| 337 case ShadowRootType::Closed: | 337 case ShadowRootType::Closed: |
| 338 ostream << "ShadowRootType::Closed"; | 338 ostream << "ShadowRootType::Closed"; |
| 339 break; | 339 break; |
| 340 } | 340 } |
| 341 return ostream; | 341 return ostream; |
| 342 } | 342 } |
| 343 | 343 |
| 344 } // namespace blink | 344 } // namespace blink |
| OLD | NEW |