| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 } else { | 78 } else { |
| 79 m_nodes.append(child); | 79 m_nodes.append(child); |
| 80 } | 80 } |
| 81 } | 81 } |
| 82 m_distributed.resize(m_nodes.size()); | 82 m_distributed.resize(m_nodes.size()); |
| 83 m_distributed.fill(false); | 83 m_distributed.fill(false); |
| 84 } | 84 } |
| 85 | 85 |
| 86 void DistributionPool::distributeTo(InsertionPoint* insertionPoint, ElementShado
w* elementShadow) | 86 void DistributionPool::distributeTo(InsertionPoint* insertionPoint, ElementShado
w* elementShadow) |
| 87 { | 87 { |
| 88 DistributedNodes distributedNodes; | 88 DistributedNodes distributedNodes(m_nodes.size()); |
| 89 | 89 |
| 90 for (size_t i = 0; i < m_nodes.size(); ++i) { | 90 for (size_t i = 0; i < m_nodes.size(); ++i) { |
| 91 if (m_distributed[i]) | 91 if (m_distributed[i]) |
| 92 continue; | 92 continue; |
| 93 | 93 |
| 94 if (isHTMLContentElement(*insertionPoint) && !toHTMLContentElement(inser
tionPoint)->canSelectNode(m_nodes, i)) | 94 if (isHTMLContentElement(*insertionPoint) && !toHTMLContentElement(inser
tionPoint)->canSelectNode(m_nodes, i)) |
| 95 continue; | 95 continue; |
| 96 | 96 |
| 97 Node* node = m_nodes[i]; | 97 Node* node = m_nodes[i]; |
| 98 distributedNodes.append(node); | 98 distributedNodes.append(node); |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 visitor->trace(m_nodeToInsertionPoints); | 383 visitor->trace(m_nodeToInsertionPoints); |
| 384 visitor->trace(m_selectFeatures); | 384 visitor->trace(m_selectFeatures); |
| 385 // Shadow roots are linked with previous and next pointers which are traced. | 385 // Shadow roots are linked with previous and next pointers which are traced. |
| 386 // It is therefore enough to trace one of the shadow roots here and the | 386 // It is therefore enough to trace one of the shadow roots here and the |
| 387 // rest will be traced from there. | 387 // rest will be traced from there. |
| 388 visitor->trace(m_shadowRoots.head()); | 388 visitor->trace(m_shadowRoots.head()); |
| 389 #endif | 389 #endif |
| 390 } | 390 } |
| 391 | 391 |
| 392 } // namespace | 392 } // namespace |
| OLD | NEW |