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

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

Issue 2460673002: Need to remove line pagination struts when no longer fragmented. (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
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 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after
1116 // 1116 //
1117 // FIXME: Another problem with simply moving lines is that the available line 1117 // FIXME: Another problem with simply moving lines is that the available line
1118 // width may change (because of floats). Technically if the location we move 1118 // width may change (because of floats). Technically if the location we move
1119 // the line to has a different line width than our old position, then we need 1119 // the line to has a different line width than our old position, then we need
1120 // to dirty the line and all following lines. 1120 // to dirty the line and all following lines.
1121 LayoutUnit logicalOffset = lineBox.lineTopWithLeading(); 1121 LayoutUnit logicalOffset = lineBox.lineTopWithLeading();
1122 LayoutUnit lineHeight = lineBox.lineBottomWithLeading() - logicalOffset; 1122 LayoutUnit lineHeight = lineBox.lineBottomWithLeading() - logicalOffset;
1123 logicalOffset += delta; 1123 logicalOffset += delta;
1124 lineBox.setPaginationStrut(LayoutUnit()); 1124 lineBox.setPaginationStrut(LayoutUnit());
1125 lineBox.setIsFirstAfterPageBreak(false); 1125 lineBox.setIsFirstAfterPageBreak(false);
1126 if (!view()->layoutState()->isPaginated())
1127 return;
1126 LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset); 1128 LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset);
1127 if (!pageLogicalHeight) 1129 if (!pageLogicalHeight)
1128 return; 1130 return;
1129 LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset( 1131 LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(
1130 logicalOffset, AssociateWithLatterPage); 1132 logicalOffset, AssociateWithLatterPage);
1131 int lineIndex = lineCount(&lineBox); 1133 int lineIndex = lineCount(&lineBox);
1132 if (remainingLogicalHeight < lineHeight || 1134 if (remainingLogicalHeight < lineHeight ||
1133 (shouldBreakAtLineToAvoidWidow() && 1135 (shouldBreakAtLineToAvoidWidow() &&
1134 lineBreakToAvoidWidow() == lineIndex)) { 1136 lineBreakToAvoidWidow() == lineIndex)) {
1135 LayoutUnit paginationStrut = calculatePaginationStrutToFitContent( 1137 LayoutUnit paginationStrut = calculatePaginationStrutToFitContent(
(...skipping 3417 matching lines...) Expand 10 before | Expand all | Expand 10 after
4553 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); 4555 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState);
4554 } 4556 }
4555 4557
4556 void LayoutBlockFlow::invalidateDisplayItemClients( 4558 void LayoutBlockFlow::invalidateDisplayItemClients(
4557 PaintInvalidationReason invalidationReason) const { 4559 PaintInvalidationReason invalidationReason) const {
4558 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients( 4560 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients(
4559 invalidationReason); 4561 invalidationReason);
4560 } 4562 }
4561 4563
4562 } // namespace blink 4564 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698