Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 3113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3124 // If the child we're removing means that we can now treat all children as | 3124 // If the child we're removing means that we can now treat all children as |
| 3125 // inline without the need for anonymous blocks, then do that. | 3125 // inline without the need for anonymous blocks, then do that. |
| 3126 MakeChildrenInlineIfPossible(); | 3126 MakeChildrenInlineIfPossible(); |
| 3127 } | 3127 } |
| 3128 } | 3128 } |
| 3129 | 3129 |
| 3130 void LayoutBlockFlow::MoveAllChildrenIncludingFloatsTo( | 3130 void LayoutBlockFlow::MoveAllChildrenIncludingFloatsTo( |
| 3131 LayoutBlock* to_block, | 3131 LayoutBlock* to_block, |
| 3132 bool full_remove_insert) { | 3132 bool full_remove_insert) { |
| 3133 LayoutBlockFlow* to_block_flow = ToLayoutBlockFlow(to_block); | 3133 LayoutBlockFlow* to_block_flow = ToLayoutBlockFlow(to_block); |
| 3134 MoveAllChildrenTo(to_block_flow, full_remove_insert); | |
| 3135 | 3134 |
| 3136 // When a portion of the layout tree is being detached, anonymous blocks | 3135 // When a portion of the layout tree is being detached, anonymous blocks |
| 3137 // will be combined as their children are deleted. In this process, the | 3136 // will be combined as their children are deleted. In this process, the |
| 3138 // anonymous block later in the tree is merged into the one preceding it. | 3137 // anonymous block later in the tree is merged into the one preceding it. |
| 3139 // It can happen that the later block (this) contains floats that the | 3138 // It can happen that the later block (this) contains floats that the |
| 3140 // previous block (toBlockFlow) did not contain, and thus are not in the | 3139 // previous block (toBlockFlow) did not contain, and thus are not in the |
| 3141 // floating objects list for toBlockFlow. This can result in toBlockFlow | 3140 // floating objects list for toBlockFlow. This can result in toBlockFlow |
| 3142 // containing floats that are not in it's floating objects list, but are in | 3141 // containing floats that are not in it's floating objects list, but are in |
| 3143 // the floating objects lists of siblings and parents. This can cause problems | 3142 // the floating objects lists of siblings and parents. This can cause problems |
| 3144 // when the float itself is deleted, since the deletion code assumes that if a | 3143 // when the float itself is deleted, since the deletion code assumes that if a |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 3162 it != end; ++it) { | 3161 it != end; ++it) { |
| 3163 const FloatingObject& floating_object = *it->get(); | 3162 const FloatingObject& floating_object = *it->get(); |
| 3164 | 3163 |
| 3165 // Don't insert the object again if it's already in the list | 3164 // Don't insert the object again if it's already in the list |
| 3166 if (to_block_flow->ContainsFloat(floating_object.GetLayoutObject())) | 3165 if (to_block_flow->ContainsFloat(floating_object.GetLayoutObject())) |
| 3167 continue; | 3166 continue; |
| 3168 | 3167 |
| 3169 to_block_flow->floating_objects_->Add(floating_object.UnsafeClone()); | 3168 to_block_flow->floating_objects_->Add(floating_object.UnsafeClone()); |
| 3170 } | 3169 } |
| 3171 } | 3170 } |
| 3171 MoveAllChildrenTo(to_block_flow, full_remove_insert); | |
|
rhogan
2017/05/05 19:04:07
If full_remove_insert is true, the object's floatl
| |
| 3172 } | 3172 } |
| 3173 | 3173 |
| 3174 void LayoutBlockFlow::ChildBecameFloatingOrOutOfFlow(LayoutBox* child) { | 3174 void LayoutBlockFlow::ChildBecameFloatingOrOutOfFlow(LayoutBox* child) { |
| 3175 MakeChildrenInlineIfPossible(); | 3175 MakeChildrenInlineIfPossible(); |
| 3176 | 3176 |
| 3177 // Reparent the child to an adjacent anonymous block if one is available. | 3177 // Reparent the child to an adjacent anonymous block if one is available. |
| 3178 LayoutObject* prev = child->PreviousSibling(); | 3178 LayoutObject* prev = child->PreviousSibling(); |
| 3179 if (prev && prev->IsAnonymousBlock() && prev->IsLayoutBlockFlow()) { | 3179 if (prev && prev->IsAnonymousBlock() && prev->IsLayoutBlockFlow()) { |
| 3180 LayoutBlockFlow* new_container = ToLayoutBlockFlow(prev); | 3180 LayoutBlockFlow* new_container = ToLayoutBlockFlow(prev); |
| 3181 MoveChildTo(new_container, child, nullptr, false); | 3181 MoveChildTo(new_container, child, nullptr, false); |
| (...skipping 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4669 return LayoutBlock::DeprecatedInvalidatePaint(paint_invalidation_state); | 4669 return LayoutBlock::DeprecatedInvalidatePaint(paint_invalidation_state); |
| 4670 } | 4670 } |
| 4671 | 4671 |
| 4672 void LayoutBlockFlow::InvalidateDisplayItemClients( | 4672 void LayoutBlockFlow::InvalidateDisplayItemClients( |
| 4673 PaintInvalidationReason invalidation_reason) const { | 4673 PaintInvalidationReason invalidation_reason) const { |
| 4674 BlockFlowPaintInvalidator(*this).InvalidateDisplayItemClients( | 4674 BlockFlowPaintInvalidator(*this).InvalidateDisplayItemClients( |
| 4675 invalidation_reason); | 4675 invalidation_reason); |
| 4676 } | 4676 } |
| 4677 | 4677 |
| 4678 } // namespace blink | 4678 } // namespace blink |
| OLD | NEW |