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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 HTMLElement::AttachLayoutTree(context); | 114 HTMLElement::AttachLayoutTree(context); |
115 } | 115 } |
116 | 116 |
117 void InsertionPoint::DetachLayoutTree(const AttachContext& context) { | 117 void InsertionPoint::DetachLayoutTree(const AttachContext& context) { |
118 for (size_t i = 0; i < distributed_nodes_.size(); ++i) | 118 for (size_t i = 0; i < distributed_nodes_.size(); ++i) |
119 distributed_nodes_.at(i)->LazyReattachIfAttached(); | 119 distributed_nodes_.at(i)->LazyReattachIfAttached(); |
120 | 120 |
121 HTMLElement::DetachLayoutTree(context); | 121 HTMLElement::DetachLayoutTree(context); |
122 } | 122 } |
123 | 123 |
| 124 void InsertionPoint::RebuildDistributedChildrenLayoutTrees() { |
| 125 Text* next_text_sibling = nullptr; |
| 126 // This loop traverses the nodes from right to left for the same reason as the |
| 127 // one described in ContainerNode::RebuildChildrenLayoutTrees(). |
| 128 for (size_t i = distributed_nodes_.size(); i > 0; --i) |
| 129 RebuildLayoutTreeForChild(distributed_nodes_.at(i - 1), next_text_sibling); |
| 130 } |
| 131 |
124 void InsertionPoint::WillRecalcStyle(StyleRecalcChange change) { | 132 void InsertionPoint::WillRecalcStyle(StyleRecalcChange change) { |
125 StyleChangeType style_change_type = kNoStyleChange; | 133 StyleChangeType style_change_type = kNoStyleChange; |
126 | 134 |
127 if (change > kInherit || GetStyleChangeType() > kLocalStyleChange) | 135 if (change > kInherit || GetStyleChangeType() > kLocalStyleChange) |
128 style_change_type = kSubtreeStyleChange; | 136 style_change_type = kSubtreeStyleChange; |
129 else if (change > kNoInherit) | 137 else if (change > kNoInherit) |
130 style_change_type = kLocalStyleChange; | 138 style_change_type = kLocalStyleChange; |
131 else | 139 else |
132 return; | 140 return; |
133 | 141 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 if (!insertion_points) | 302 if (!insertion_points) |
295 return; | 303 return; |
296 for (size_t i = 0; i < insertion_points->size(); ++i) | 304 for (size_t i = 0; i < insertion_points->size(); ++i) |
297 results.push_back(insertion_points->at(i).Get()); | 305 results.push_back(insertion_points->at(i).Get()); |
298 DCHECK_NE(current, insertion_points->back().Get()); | 306 DCHECK_NE(current, insertion_points->back().Get()); |
299 current = insertion_points->back().Get(); | 307 current = insertion_points->back().Get(); |
300 } | 308 } |
301 } | 309 } |
302 | 310 |
303 } // namespace blink | 311 } // namespace blink |
OLD | NEW |