| 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 { | 134 { |
| 135 // FIXME(sky): Remove this. | 135 // FIXME(sky): Remove this. |
| 136 return canBeActive(); | 136 return canBeActive(); |
| 137 } | 137 } |
| 138 | 138 |
| 139 bool InsertionPoint::isContentInsertionPoint() const | 139 bool InsertionPoint::isContentInsertionPoint() const |
| 140 { | 140 { |
| 141 return isHTMLContentElement(*this) && isActive(); | 141 return isHTMLContentElement(*this) && isActive(); |
| 142 } | 142 } |
| 143 | 143 |
| 144 PassRefPtr<StaticNodeList> InsertionPoint::getDistributedNodes() | 144 Vector<RefPtr<Node>> InsertionPoint::getDistributedNodes() |
| 145 { | 145 { |
| 146 document().updateDistributionForNodeIfNeeded(this); | 146 document().updateDistributionForNodeIfNeeded(this); |
| 147 | 147 |
| 148 Vector<RefPtr<Node> > nodes; | 148 Vector<RefPtr<Node> > result; |
| 149 nodes.reserveInitialCapacity(m_distribution.size()); | 149 result.reserveInitialCapacity(m_distribution.size()); |
| 150 for (size_t i = 0; i < m_distribution.size(); ++i) | 150 for (size_t i = 0; i < m_distribution.size(); ++i) |
| 151 nodes.uncheckedAppend(m_distribution.at(i)); | 151 result.uncheckedAppend(m_distribution.at(i)); |
| 152 | 152 return result; |
| 153 return StaticNodeList::adopt(nodes); | |
| 154 } | 153 } |
| 155 | 154 |
| 156 void InsertionPoint::childrenChanged(const ChildrenChange& change) | 155 void InsertionPoint::childrenChanged(const ChildrenChange& change) |
| 157 { | 156 { |
| 158 HTMLElement::childrenChanged(change); | 157 HTMLElement::childrenChanged(change); |
| 159 if (ShadowRoot* root = containingShadowRoot()) { | 158 if (ShadowRoot* root = containingShadowRoot()) { |
| 160 if (ElementShadow* rootOwner = root->owner()) | 159 if (ElementShadow* rootOwner = root->owner()) |
| 161 rootOwner->setNeedsDistributionRecalc(); | 160 rootOwner->setNeedsDistributionRecalc(); |
| 162 } | 161 } |
| 163 } | 162 } |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 if (!insertionPoints) | 241 if (!insertionPoints) |
| 243 return; | 242 return; |
| 244 for (size_t i = 0; i < insertionPoints->size(); ++i) | 243 for (size_t i = 0; i < insertionPoints->size(); ++i) |
| 245 results.append(insertionPoints->at(i).get()); | 244 results.append(insertionPoints->at(i).get()); |
| 246 ASSERT(current != insertionPoints->last().get()); | 245 ASSERT(current != insertionPoints->last().get()); |
| 247 current = insertionPoints->last().get(); | 246 current = insertionPoints->last().get(); |
| 248 } | 247 } |
| 249 } | 248 } |
| 250 | 249 |
| 251 } // namespace blink | 250 } // namespace blink |
| OLD | NEW |