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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 distributedNodes.clear(); | 99 distributedNodes.clear(); |
100 m_distributedNodes.shrinkToFit(); | 100 m_distributedNodes.shrinkToFit(); |
101 } | 101 } |
102 | 102 |
103 void InsertionPoint::attachLayoutTree(const AttachContext& context) { | 103 void InsertionPoint::attachLayoutTree(const AttachContext& context) { |
104 // We need to attach the distribution here so that they're inserted in the | 104 // We need to attach the distribution here so that they're inserted in the |
105 // right order otherwise the n^2 protection inside LayoutTreeBuilder will | 105 // right order otherwise the n^2 protection inside LayoutTreeBuilder will |
106 // cause them to be inserted in the wrong place later. This also lets | 106 // cause them to be inserted in the wrong place later. This also lets |
107 // distributed nodes benefit from the n^2 protection. | 107 // distributed nodes benefit from the n^2 protection. |
108 for (size_t i = 0; i < m_distributedNodes.size(); ++i) { | 108 for (size_t i = 0; i < m_distributedNodes.size(); ++i) { |
109 if (m_distributedNodes.at(i)->needsAttach()) | 109 if (m_distributedNodes.at(i)->needsReattachLayoutTree()) |
110 m_distributedNodes.at(i)->attachLayoutTree(context); | 110 m_distributedNodes.at(i)->attachLayoutTree(context); |
111 } | 111 } |
112 | 112 |
113 HTMLElement::attachLayoutTree(context); | 113 HTMLElement::attachLayoutTree(context); |
114 } | 114 } |
115 | 115 |
116 void InsertionPoint::detachLayoutTree(const AttachContext& context) { | 116 void InsertionPoint::detachLayoutTree(const AttachContext& context) { |
117 for (size_t i = 0; i < m_distributedNodes.size(); ++i) | 117 for (size_t i = 0; i < m_distributedNodes.size(); ++i) |
118 m_distributedNodes.at(i)->lazyReattachIfAttached(); | 118 m_distributedNodes.at(i)->lazyReattachIfAttached(); |
119 | 119 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 if (!insertionPoints) | 296 if (!insertionPoints) |
297 return; | 297 return; |
298 for (size_t i = 0; i < insertionPoints->size(); ++i) | 298 for (size_t i = 0; i < insertionPoints->size(); ++i) |
299 results.append(insertionPoints->at(i).get()); | 299 results.append(insertionPoints->at(i).get()); |
300 DCHECK_NE(current, insertionPoints->back().get()); | 300 DCHECK_NE(current, insertionPoints->back().get()); |
301 current = insertionPoints->back().get(); | 301 current = insertionPoints->back().get(); |
302 } | 302 } |
303 } | 303 } |
304 | 304 |
305 } // namespace blink | 305 } // namespace blink |
OLD | NEW |