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

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

Issue 1883163002: Don't call paginatedContentWasLaidOut() until we have the final layout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/multicol/nested-balanced-with-strut-before-first-line-expected.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 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 // If the child moved, we have to invalidate its paint as well as any floati ng/positioned 719 // If the child moved, we have to invalidate its paint as well as any floati ng/positioned
720 // descendants. An exception is if we need a layout. In this case, we know w e're going to 720 // descendants. An exception is if we need a layout. In this case, we know w e're going to
721 // invalidate our paint (and the child) anyway. 721 // invalidate our paint (and the child) anyway.
722 if (!selfNeedsLayout() && (childOffset.width() || childOffset.height())) 722 if (!selfNeedsLayout() && (childOffset.width() || childOffset.height()))
723 child.invalidatePaintForOverhangingFloats(true); 723 child.invalidatePaintForOverhangingFloats(true);
724 724
725 if (paginated) { 725 if (paginated) {
726 // Keep track of the break-after value of the child, so that it can be j oined with the 726 // Keep track of the break-after value of the child, so that it can be j oined with the
727 // break-before value of the next in-flow object at the next class A bre ak point. 727 // break-before value of the next in-flow object at the next class A bre ak point.
728 layoutInfo.setPreviousBreakAfterValue(child.breakAfter()); 728 layoutInfo.setPreviousBreakAfterValue(child.breakAfter());
729
730 paginatedContentWasLaidOut(child.logicalBottom());
729 } 731 }
730 732
731 if (child.isLayoutMultiColumnSpannerPlaceholder()) { 733 if (child.isLayoutMultiColumnSpannerPlaceholder()) {
732 // The actual column-span:all element is positioned by this placeholder child. 734 // The actual column-span:all element is positioned by this placeholder child.
733 positionSpannerDescendant(toLayoutMultiColumnSpannerPlaceholder(child)); 735 positionSpannerDescendant(toLayoutMultiColumnSpannerPlaceholder(child));
734 } 736 }
735 } 737 }
736 738
737 LayoutUnit LayoutBlockFlow::adjustBlockChildForPagination(LayoutUnit logicalTop, LayoutBox& child, BlockChildrenLayoutInfo& layoutInfo, bool atBeforeSideOfBlock ) 739 LayoutUnit LayoutBlockFlow::adjustBlockChildForPagination(LayoutUnit logicalTop, LayoutBox& child, BlockChildrenLayoutInfo& layoutInfo, bool atBeforeSideOfBlock )
738 { 740 {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 paginationStrut += logicalTop + marginBeforeIfFloating(); 782 paginationStrut += logicalTop + marginBeforeIfFloating();
781 setPaginationStrutPropagatedFromChild(paginationStrut); 783 setPaginationStrutPropagatedFromChild(paginationStrut);
782 if (childBlockFlow) 784 if (childBlockFlow)
783 childBlockFlow->setPaginationStrutPropagatedFromChild(LayoutUnit ()); 785 childBlockFlow->setPaginationStrutPropagatedFromChild(LayoutUnit ());
784 } else { 786 } else {
785 child.setPaginationStrut(paginationStrut); 787 child.setPaginationStrut(paginationStrut);
786 newLogicalTop += paginationStrut; 788 newLogicalTop += paginationStrut;
787 } 789 }
788 } 790 }
789 791
790 paginatedContentWasLaidOut(newLogicalTop + child.logicalHeight());
791
792 // Similar to how we apply clearance. Go ahead and boost height() to be the place where we're going to position the child. 792 // Similar to how we apply clearance. Go ahead and boost height() to be the place where we're going to position the child.
793 setLogicalHeight(logicalHeight() + (newLogicalTop - logicalTop)); 793 setLogicalHeight(logicalHeight() + (newLogicalTop - logicalTop));
794 794
795 // Return the final adjusted logical top. 795 // Return the final adjusted logical top.
796 return newLogicalTop; 796 return newLogicalTop;
797 } 797 }
798 798
799 static bool shouldSetStrutOnBlock(const LayoutBlockFlow& block, const RootInline Box& lineBox, LayoutUnit lineLogicalOffset, int lineIndex, LayoutUnit pageLogica lHeight) 799 static bool shouldSetStrutOnBlock(const LayoutBlockFlow& block, const RootInline Box& lineBox, LayoutUnit lineLogicalOffset, int lineIndex, LayoutUnit pageLogica lHeight)
800 { 800 {
801 bool wantsStrutOnBlock = false; 801 bool wantsStrutOnBlock = false;
(...skipping 2228 matching lines...) Expand 10 before | Expand all | Expand 10 after
3030 // FIXME: Glyph overflow will get lost in this case, but not really a big de al. 3030 // FIXME: Glyph overflow will get lost in this case, but not really a big de al.
3031 GlyphOverflowAndFallbackFontsMap textBoxDataMap; 3031 GlyphOverflowAndFallbackFontsMap textBoxDataMap;
3032 for (ListHashSet<RootInlineBox*>::const_iterator it = lineBoxes.begin(); it != lineBoxes.end(); ++it) { 3032 for (ListHashSet<RootInlineBox*>::const_iterator it = lineBoxes.begin(); it != lineBoxes.end(); ++it) {
3033 RootInlineBox* box = *it; 3033 RootInlineBox* box = *it;
3034 box->computeOverflow(box->lineTop(), box->lineBottom(), textBoxDataMap); 3034 box->computeOverflow(box->lineTop(), box->lineBottom(), textBoxDataMap);
3035 } 3035 }
3036 return childrenOverflowChanged; 3036 return childrenOverflowChanged;
3037 } 3037 }
3038 3038
3039 } // namespace blink 3039 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/multicol/nested-balanced-with-strut-before-first-line-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698