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

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

Issue 2479173002: There should never be unplaced floats from other blocks. (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3614 matching lines...) Expand 10 before | Expand all | Expand 10 after
3625 // The float cannot start above the top position of the last positioned float. 3625 // The float cannot start above the top position of the last positioned float.
3626 if (lastPlacedFloatingObject) 3626 if (lastPlacedFloatingObject)
3627 logicalTop = 3627 logicalTop =
3628 std::max(logicalTopForFloat(*lastPlacedFloatingObject), logicalTop); 3628 std::max(logicalTopForFloat(*lastPlacedFloatingObject), logicalTop);
3629 3629
3630 FloatingObjectSetIterator end = floatingObjectSet.end(); 3630 FloatingObjectSetIterator end = floatingObjectSet.end();
3631 // Now walk through the set of unpositioned floats and place them. 3631 // Now walk through the set of unpositioned floats and place them.
3632 for (; it != end; ++it) { 3632 for (; it != end; ++it) {
3633 FloatingObject& floatingObject = *it->get(); 3633 FloatingObject& floatingObject = *it->get();
3634 // The containing block is responsible for positioning floats, so if we have 3634 // The containing block is responsible for positioning floats, so if we have
3635 // floats in our list that come from somewhere else, do not attempt to 3635 // unplaced floats in our list that come from somewhere else, we have a bug.
3636 // position them. 3636 DCHECK_EQ(floatingObject.layoutObject()->containingBlock(), this);
3637 if (floatingObject.layoutObject()->containingBlock() != this)
3638 continue;
3639 3637
3640 LayoutBox* childBox = floatingObject.layoutObject(); 3638 LayoutBox* childBox = floatingObject.layoutObject();
3641 3639
3642 // FIXME Investigate if this can be removed. crbug.com/370006 3640 // FIXME Investigate if this can be removed. crbug.com/370006
3643 childBox->setMayNeedPaintInvalidation(); 3641 childBox->setMayNeedPaintInvalidation();
3644 3642
3645 LayoutUnit childLogicalLeftMargin = style()->isLeftToRightDirection() 3643 LayoutUnit childLogicalLeftMargin = style()->isLeftToRightDirection()
3646 ? marginStartForChild(*childBox) 3644 ? marginStartForChild(*childBox)
3647 : marginEndForChild(*childBox); 3645 : marginEndForChild(*childBox);
3648 if (childBox->style()->clear() & ClearLeft) 3646 if (childBox->style()->clear() & ClearLeft)
(...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after
4566 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); 4564 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState);
4567 } 4565 }
4568 4566
4569 void LayoutBlockFlow::invalidateDisplayItemClients( 4567 void LayoutBlockFlow::invalidateDisplayItemClients(
4570 PaintInvalidationReason invalidationReason) const { 4568 PaintInvalidationReason invalidationReason) const {
4571 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients( 4569 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients(
4572 invalidationReason); 4570 invalidationReason);
4573 } 4571 }
4574 4572
4575 } // namespace blink 4573 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698