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

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

Issue 2587673003: Content of cell should avoid repeating headers when it straddles multiple pages (Closed)
Patch Set: bug 675453 Created 3 years, 12 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 5569 matching lines...) Expand 10 before | Expand all | Expand 10 after
5580 return pageRemainingLogicalHeightForOffset(offset, AssociateWithLatterPage) < 5580 return pageRemainingLogicalHeightForOffset(offset, AssociateWithLatterPage) <
5581 logicalHeight; 5581 logicalHeight;
5582 } 5582 }
5583 5583
5584 LayoutUnit LayoutBox::calculatePaginationStrutToFitContent( 5584 LayoutUnit LayoutBox::calculatePaginationStrutToFitContent(
5585 LayoutUnit offset, 5585 LayoutUnit offset,
5586 LayoutUnit strutToNextPage, 5586 LayoutUnit strutToNextPage,
5587 LayoutUnit contentLogicalHeight) const { 5587 LayoutUnit contentLogicalHeight) const {
5588 ASSERT(strutToNextPage == 5588 ASSERT(strutToNextPage ==
5589 pageRemainingLogicalHeightForOffset(offset, AssociateWithLatterPage)); 5589 pageRemainingLogicalHeightForOffset(offset, AssociateWithLatterPage));
5590 // If we're a cell in a row that straddles a page then avoid the repeating
5591 // header group if necessary.
5592 if (isTableCell()) {
5593 const LayoutTableCell* cell = toLayoutTableCell(this);
5594 if (!cell->row()->isFirstRowInSectionAfterHeader())
5595 strutToNextPage += cell->table()->rowOffsetFromRepeatingHeader();
5596 }
5590 LayoutUnit nextPageLogicalTop = offset + strutToNextPage; 5597 LayoutUnit nextPageLogicalTop = offset + strutToNextPage;
5591 if (pageLogicalHeightForOffset(nextPageLogicalTop) >= contentLogicalHeight) 5598 if (pageLogicalHeightForOffset(nextPageLogicalTop) >= contentLogicalHeight)
5592 return strutToNextPage; // Content fits just fine in the next page or 5599 return strutToNextPage; // Content fits just fine in the next page or
5593 // column. 5600 // column.
5594 5601
5595 // Moving to the top of the next page or column doesn't result in enough space 5602 // Moving to the top of the next page or column doesn't result in enough space
5596 // for the content that we're trying to fit. If we're in a nested 5603 // for the content that we're trying to fit. If we're in a nested
5597 // fragmentation context, we may find enough space if we move to a column 5604 // fragmentation context, we may find enough space if we move to a column
5598 // further ahead, by effectively breaking to the next outer fragmentainer. 5605 // further ahead, by effectively breaking to the next outer fragmentainer.
5599 LayoutFlowThread* flowThread = flowThreadContainingBlock(); 5606 LayoutFlowThread* flowThread = flowThreadContainingBlock();
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
5660 block->adjustChildDebugRect(rect); 5667 block->adjustChildDebugRect(rect);
5661 5668
5662 return rect; 5669 return rect;
5663 } 5670 }
5664 5671
5665 bool LayoutBox::shouldClipOverflow() const { 5672 bool LayoutBox::shouldClipOverflow() const {
5666 return hasOverflowClip() || styleRef().containsPaint() || hasControlClip(); 5673 return hasOverflowClip() || styleRef().containsPaint() || hasControlClip();
5667 } 5674 }
5668 5675
5669 } // namespace blink 5676 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698