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

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

Issue 2836293003: Let siblings layout if an adjacent float may no longer affect them (Closed)
Patch Set: bug 711938 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/block/float/margin-top-changes.html ('k') | 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 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 mark_descendants_with_floats = true; 682 mark_descendants_with_floats = true;
683 } else if (UNLIKELY(new_logical_top.MightBeSaturated())) { 683 } else if (UNLIKELY(new_logical_top.MightBeSaturated())) {
684 // The logical top might be saturated for very large elements. Comparing 684 // The logical top might be saturated for very large elements. Comparing
685 // with the old logical top might then yield a false negative, as adding and 685 // with the old logical top might then yield a false negative, as adding and
686 // removing margins, borders etc. from a saturated number might yield 686 // removing margins, borders etc. from a saturated number might yield
687 // incorrect results. If this is the case, always mark for layout. 687 // incorrect results. If this is the case, always mark for layout.
688 mark_descendants_with_floats = true; 688 mark_descendants_with_floats = true;
689 } else if (!child.AvoidsFloats() || child.ShrinkToAvoidFloats()) { 689 } else if (!child.AvoidsFloats() || child.ShrinkToAvoidFloats()) {
690 // If an element might be affected by the presence of floats, then always 690 // If an element might be affected by the presence of floats, then always
691 // mark it for layout. 691 // mark it for layout.
692 if (std::max(previous_float_logical_bottom, LowestFloatLogicalBottom()) > 692 LayoutUnit lowest_float =
693 new_logical_top) 693 std::max(previous_float_logical_bottom, LowestFloatLogicalBottom());
694 lowest_float = std::max(lowest_float, child.LowestFloatLogicalBottom());
695 if (lowest_float > new_logical_top)
694 mark_descendants_with_floats = true; 696 mark_descendants_with_floats = true;
695 } 697 }
696 698
697 if (mark_descendants_with_floats) 699 if (mark_descendants_with_floats)
698 child.MarkAllDescendantsWithFloatsForLayout(); 700 child.MarkAllDescendantsWithFloatsForLayout();
699 } 701 }
700 702
701 bool LayoutBlockFlow::PositionAndLayoutOnceIfNeeded( 703 bool LayoutBlockFlow::PositionAndLayoutOnceIfNeeded(
702 LayoutBox& child, 704 LayoutBox& child,
703 LayoutUnit new_logical_top, 705 LayoutUnit new_logical_top,
(...skipping 3951 matching lines...) Expand 10 before | Expand all | Expand 10 after
4655 return LayoutBlock::InvalidatePaintIfNeeded(paint_invalidation_state); 4657 return LayoutBlock::InvalidatePaintIfNeeded(paint_invalidation_state);
4656 } 4658 }
4657 4659
4658 void LayoutBlockFlow::InvalidateDisplayItemClients( 4660 void LayoutBlockFlow::InvalidateDisplayItemClients(
4659 PaintInvalidationReason invalidation_reason) const { 4661 PaintInvalidationReason invalidation_reason) const {
4660 BlockFlowPaintInvalidator(*this).InvalidateDisplayItemClients( 4662 BlockFlowPaintInvalidator(*this).InvalidateDisplayItemClients(
4661 invalidation_reason); 4663 invalidation_reason);
4662 } 4664 }
4663 4665
4664 } // namespace blink 4666 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/block/float/margin-top-changes.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698