| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 oldRoot->setParentOrShadowHostNode(0); | 65 oldRoot->setParentOrShadowHostNode(0); |
| 66 oldRoot->setParentTreeScope(shadowHost->document()); | 66 oldRoot->setParentTreeScope(shadowHost->document()); |
| 67 oldRoot->setPrev(0); | 67 oldRoot->setPrev(0); |
| 68 oldRoot->setNext(0); | 68 oldRoot->setNext(0); |
| 69 ChildNodeRemovalNotifier(shadowHost).notify(oldRoot.get()); | 69 ChildNodeRemovalNotifier(shadowHost).notify(oldRoot.get()); |
| 70 } | 70 } |
| 71 | 71 |
| 72 m_distributor.invalidateDistribution(shadowHost); | 72 m_distributor.invalidateDistribution(shadowHost); |
| 73 } | 73 } |
| 74 | 74 |
| 75 void ElementShadow::attach() | 75 void ElementShadow::attach(const Node::AttachContext& context) |
| 76 { | 76 { |
| 77 ContentDistributor::ensureDistribution(host()); | 77 ContentDistributor::ensureDistribution(host()); |
| 78 | 78 |
| 79 Node::AttachContext childrenContext(context); |
| 80 childrenContext.resolvedStyle = 0; |
| 81 |
| 79 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadow
Root()) { | 82 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadow
Root()) { |
| 80 if (!root->attached()) | 83 if (!root->attached()) |
| 81 root->attach(); | 84 root->attach(childrenContext); |
| 82 } | 85 } |
| 83 } | 86 } |
| 84 | 87 |
| 85 void ElementShadow::detach() | 88 void ElementShadow::detach(const Node::AttachContext& context) |
| 86 { | 89 { |
| 90 Node::AttachContext childrenContext(context); |
| 91 childrenContext.resolvedStyle = 0; |
| 92 |
| 87 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadow
Root()) { | 93 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadow
Root()) { |
| 88 if (root->attached()) | 94 if (root->attached()) |
| 89 root->detach(); | 95 root->detach(childrenContext); |
| 90 } | 96 } |
| 91 } | 97 } |
| 92 | 98 |
| 93 bool ElementShadow::childNeedsStyleRecalc() const | 99 bool ElementShadow::childNeedsStyleRecalc() const |
| 94 { | 100 { |
| 95 ASSERT(youngestShadowRoot()); | 101 ASSERT(youngestShadowRoot()); |
| 96 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadow
Root()) | 102 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadow
Root()) |
| 97 if (root->childNeedsStyleRecalc()) | 103 if (root->childNeedsStyleRecalc()) |
| 98 return true; | 104 return true; |
| 99 | 105 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 130 info.addMember(m_shadowRoots, "shadowRoots"); | 136 info.addMember(m_shadowRoots, "shadowRoots"); |
| 131 ShadowRoot* shadowRoot = m_shadowRoots.head(); | 137 ShadowRoot* shadowRoot = m_shadowRoots.head(); |
| 132 while (shadowRoot) { | 138 while (shadowRoot) { |
| 133 info.addMember(shadowRoot, "shadowRoot"); | 139 info.addMember(shadowRoot, "shadowRoot"); |
| 134 shadowRoot = shadowRoot->next(); | 140 shadowRoot = shadowRoot->next(); |
| 135 } | 141 } |
| 136 info.addMember(m_distributor, "distributor"); | 142 info.addMember(m_distributor, "distributor"); |
| 137 } | 143 } |
| 138 | 144 |
| 139 } // namespace | 145 } // namespace |
| OLD | NEW |