| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 inline void DistributionPool::detachNonDistributedNodes() | 115 inline void DistributionPool::detachNonDistributedNodes() |
| 116 { | 116 { |
| 117 for (size_t i = 0; i < m_nodes.size(); ++i) { | 117 for (size_t i = 0; i < m_nodes.size(); ++i) { |
| 118 if (m_distributed[i]) | 118 if (m_distributed[i]) |
| 119 continue; | 119 continue; |
| 120 if (m_nodes[i]->renderer()) | 120 if (m_nodes[i]->renderer()) |
| 121 m_nodes[i]->lazyReattachIfAttached(); | 121 m_nodes[i]->lazyReattachIfAttached(); |
| 122 } | 122 } |
| 123 } | 123 } |
| 124 | 124 |
| 125 PassOwnPtr<ElementShadow> ElementShadow::create() | 125 PassOwnPtrWillBeRawPtr<ElementShadow> ElementShadow::create() |
| 126 { | 126 { |
| 127 return adoptPtr(new ElementShadow()); | 127 return adoptPtrWillBeNoop(new ElementShadow()); |
| 128 } | 128 } |
| 129 | 129 |
| 130 ElementShadow::ElementShadow() | 130 ElementShadow::ElementShadow() |
| 131 : m_needsDistributionRecalc(false) | 131 : m_needsDistributionRecalc(false) |
| 132 , m_needsSelectFeatureSet(false) | 132 , m_needsSelectFeatureSet(false) |
| 133 { | 133 { |
| 134 } | 134 } |
| 135 | 135 |
| 136 ElementShadow::~ElementShadow() | 136 ElementShadow::~ElementShadow() |
| 137 { | 137 { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 | 171 |
| 172 while (RefPtr<ShadowRoot> oldRoot = m_shadowRoots.head()) { | 172 while (RefPtr<ShadowRoot> oldRoot = m_shadowRoots.head()) { |
| 173 InspectorInstrumentation::willPopShadowRoot(shadowHost, oldRoot.get()); | 173 InspectorInstrumentation::willPopShadowRoot(shadowHost, oldRoot.get()); |
| 174 shadowHost->document().removeFocusedElementOfSubtree(oldRoot.get()); | 174 shadowHost->document().removeFocusedElementOfSubtree(oldRoot.get()); |
| 175 m_shadowRoots.removeHead(); | 175 m_shadowRoots.removeHead(); |
| 176 oldRoot->setParentOrShadowHostNode(0); | 176 oldRoot->setParentOrShadowHostNode(0); |
| 177 oldRoot->setParentTreeScope(shadowHost->document()); | 177 oldRoot->setParentTreeScope(shadowHost->document()); |
| 178 oldRoot->setPrev(0); | 178 oldRoot->setPrev(0); |
| 179 oldRoot->setNext(0); | 179 oldRoot->setNext(0); |
| 180 } | 180 } |
| 181 | |
| 182 } | 181 } |
| 183 | 182 |
| 184 void ElementShadow::attach(const Node::AttachContext& context) | 183 void ElementShadow::attach(const Node::AttachContext& context) |
| 185 { | 184 { |
| 186 Node::AttachContext childrenContext(context); | 185 Node::AttachContext childrenContext(context); |
| 187 childrenContext.resolvedStyle = 0; | 186 childrenContext.resolvedStyle = 0; |
| 188 | 187 |
| 189 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadow
Root()) { | 188 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadow
Root()) { |
| 190 if (root->needsAttach()) | 189 if (root->needsAttach()) |
| 191 root->attach(childrenContext); | 190 root->attach(childrenContext); |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 | 353 |
| 355 void ElementShadow::trace(Visitor* visitor) | 354 void ElementShadow::trace(Visitor* visitor) |
| 356 { | 355 { |
| 357 // Shadow roots are linked with previous and next pointers which are traced. | 356 // Shadow roots are linked with previous and next pointers which are traced. |
| 358 // It is therefore enough to trace one of the shadow roots here and the | 357 // It is therefore enough to trace one of the shadow roots here and the |
| 359 // rest will be traced from there. | 358 // rest will be traced from there. |
| 360 visitor->trace(m_shadowRoots.head()); | 359 visitor->trace(m_shadowRoots.head()); |
| 361 } | 360 } |
| 362 | 361 |
| 363 } // namespace | 362 } // namespace |
| OLD | NEW |