Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp

Issue 2876943002: Flowthread should move its floatlists to container when evacuating (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 3111 matching lines...) Expand 10 before | Expand all | Expand 10 after
3122 // If the child we're removing means that we can now treat all children as 3122 // If the child we're removing means that we can now treat all children as
3123 // inline without the need for anonymous blocks, then do that. 3123 // inline without the need for anonymous blocks, then do that.
3124 MakeChildrenInlineIfPossible(); 3124 MakeChildrenInlineIfPossible();
3125 } 3125 }
3126 } 3126 }
3127 3127
3128 void LayoutBlockFlow::MoveAllChildrenIncludingFloatsTo( 3128 void LayoutBlockFlow::MoveAllChildrenIncludingFloatsTo(
3129 LayoutBlock* to_block, 3129 LayoutBlock* to_block,
3130 bool full_remove_insert) { 3130 bool full_remove_insert) {
3131 LayoutBlockFlow* to_block_flow = ToLayoutBlockFlow(to_block); 3131 LayoutBlockFlow* to_block_flow = ToLayoutBlockFlow(to_block);
3132 MoveAllChildrenTo(to_block_flow, full_remove_insert);
3133 3132
3134 // When a portion of the layout tree is being detached, anonymous blocks 3133 // When a portion of the layout tree is being detached, anonymous blocks
3135 // will be combined as their children are deleted. In this process, the 3134 // will be combined as their children are deleted. In this process, the
3136 // anonymous block later in the tree is merged into the one preceding it. 3135 // anonymous block later in the tree is merged into the one preceding it.
3137 // It can happen that the later block (this) contains floats that the 3136 // It can happen that the later block (this) contains floats that the
3138 // previous block (toBlockFlow) did not contain, and thus are not in the 3137 // previous block (toBlockFlow) did not contain, and thus are not in the
3139 // floating objects list for toBlockFlow. This can result in toBlockFlow 3138 // floating objects list for toBlockFlow. This can result in toBlockFlow
3140 // containing floats that are not in it's floating objects list, but are in 3139 // containing floats that are not in it's floating objects list, but are in
3141 // the floating objects lists of siblings and parents. This can cause problems 3140 // the floating objects lists of siblings and parents. This can cause problems
3142 // when the float itself is deleted, since the deletion code assumes that if a 3141 // when the float itself is deleted, since the deletion code assumes that if a
(...skipping 17 matching lines...) Expand all
3160 it != end; ++it) { 3159 it != end; ++it) {
3161 const FloatingObject& floating_object = *it->get(); 3160 const FloatingObject& floating_object = *it->get();
3162 3161
3163 // Don't insert the object again if it's already in the list 3162 // Don't insert the object again if it's already in the list
3164 if (to_block_flow->ContainsFloat(floating_object.GetLayoutObject())) 3163 if (to_block_flow->ContainsFloat(floating_object.GetLayoutObject()))
3165 continue; 3164 continue;
3166 3165
3167 to_block_flow->floating_objects_->Add(floating_object.UnsafeClone()); 3166 to_block_flow->floating_objects_->Add(floating_object.UnsafeClone());
3168 } 3167 }
3169 } 3168 }
3169 MoveAllChildrenTo(to_block_flow, full_remove_insert);
3170 } 3170 }
3171 3171
3172 void LayoutBlockFlow::ChildBecameFloatingOrOutOfFlow(LayoutBox* child) { 3172 void LayoutBlockFlow::ChildBecameFloatingOrOutOfFlow(LayoutBox* child) {
3173 MakeChildrenInlineIfPossible(); 3173 MakeChildrenInlineIfPossible();
3174 3174
3175 // Reparent the child to an adjacent anonymous block if one is available. 3175 // Reparent the child to an adjacent anonymous block if one is available.
3176 LayoutObject* prev = child->PreviousSibling(); 3176 LayoutObject* prev = child->PreviousSibling();
3177 if (prev && prev->IsAnonymousBlock() && prev->IsLayoutBlockFlow()) { 3177 if (prev && prev->IsAnonymousBlock() && prev->IsLayoutBlockFlow()) {
3178 LayoutBlockFlow* new_container = ToLayoutBlockFlow(prev); 3178 LayoutBlockFlow* new_container = ToLayoutBlockFlow(prev);
3179 MoveChildTo(new_container, child, nullptr, false); 3179 MoveChildTo(new_container, child, nullptr, false);
(...skipping 1475 matching lines...) Expand 10 before | Expand all | Expand 10 after
4655 return LayoutBlock::InvalidatePaintIfNeeded(paint_invalidation_state); 4655 return LayoutBlock::InvalidatePaintIfNeeded(paint_invalidation_state);
4656 } 4656 }
4657 4657
4658 void LayoutBlockFlow::InvalidateDisplayItemClients( 4658 void LayoutBlockFlow::InvalidateDisplayItemClients(
4659 PaintInvalidationReason invalidation_reason) const { 4659 PaintInvalidationReason invalidation_reason) const {
4660 BlockFlowPaintInvalidator(*this).InvalidateDisplayItemClients( 4660 BlockFlowPaintInvalidator(*this).InvalidateDisplayItemClients(
4661 invalidation_reason); 4661 invalidation_reason);
4662 } 4662 }
4663 4663
4664 } // namespace blink 4664 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698