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

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

Issue 2545243002: Don't repeat thead if the first row exceeds the height of the page (Closed)
Patch Set: bug 669690 Created 4 years 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) 1997 Martin Jones (mjones@kde.org) 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 * (C) 1997 Torben Weis (weis@kde.org) 3 * (C) 1997 Torben Weis (weis@kde.org)
4 * (C) 1998 Waldo Bastian (bastian@kde.org) 4 * (C) 1998 Waldo Bastian (bastian@kde.org)
5 * (C) 1999 Lars Knoll (knoll@kde.org) 5 * (C) 1999 Lars Knoll (knoll@kde.org)
6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 * (C) 1999 Antti Koivisto (koivisto@kde.org)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc.
8 * All rights reserved. 8 * All rights reserved.
9 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 9 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
10 * 10 *
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 if (LayoutTableSection* section = header()) { 628 if (LayoutTableSection* section = header()) {
629 layoutSection(*section, layouter, sectionLogicalLeft); 629 layoutSection(*section, layouter, sectionLogicalLeft);
630 if (state.isPaginated()) { 630 if (state.isPaginated()) {
631 // If the repeating header group allows at least one row of content, 631 // If the repeating header group allows at least one row of content,
632 // then store the offset for other sections to offset their rows 632 // then store the offset for other sections to offset their rows
633 // against. 633 // against.
634 LayoutUnit sectionLogicalHeight = section->logicalHeight(); 634 LayoutUnit sectionLogicalHeight = section->logicalHeight();
635 if (sectionLogicalHeight < 635 if (sectionLogicalHeight <
636 section->pageLogicalHeightForOffset(section->logicalTop()) && 636 section->pageLogicalHeightForOffset(section->logicalTop()) &&
637 section->getPaginationBreakability() != AllowAnyBreaks) { 637 section->getPaginationBreakability() != AllowAnyBreaks) {
638 LayoutUnit offsetForTableHeaders =
639 state.heightOffsetForTableHeaders();
640 // Don't include any strut in the header group - we only want the 638 // Don't include any strut in the header group - we only want the
641 // height from its content. 639 // height from its content.
642 offsetForTableHeaders += sectionLogicalHeight; 640 LayoutUnit offsetForTableHeaders = sectionLogicalHeight;
643 if (LayoutTableRow* row = section->firstRow()) 641 if (LayoutTableRow* row = section->firstRow())
644 offsetForTableHeaders -= row->paginationStrut(); 642 offsetForTableHeaders -= row->paginationStrut();
645 section->setOffsetForRepeatingHeader( 643 setRowOffsetFromRepeatingHeader(offsetForTableHeaders);
646 state.heightOffsetForTableHeaders());
647 state.setHeightOffsetForTableHeaders(offsetForTableHeaders);
648 } 644 }
649 } 645 }
650 } 646 }
651 647
652 // Lay out table body groups, and column groups. 648 // Lay out table body groups, and column groups.
653 for (LayoutObject* child = firstChild(); child; 649 for (LayoutObject* child = firstChild(); child;
654 child = child->nextSibling()) { 650 child = child->nextSibling()) {
655 if (child->isTableSection()) { 651 if (child->isTableSection()) {
656 if (child != header() && child != footer()) { 652 if (child != header() && child != footer()) {
657 LayoutTableSection& section = *toLayoutTableSection(child); 653 LayoutTableSection& section = *toLayoutTableSection(child);
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after
1696 } 1692 }
1697 1693
1698 LayoutUnit LayoutTable::paddingRight() const { 1694 LayoutUnit LayoutTable::paddingRight() const {
1699 if (collapseBorders()) 1695 if (collapseBorders())
1700 return LayoutUnit(); 1696 return LayoutUnit();
1701 1697
1702 return LayoutBlock::paddingRight(); 1698 return LayoutBlock::paddingRight();
1703 } 1699 }
1704 1700
1705 } // namespace blink 1701 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTable.h ('k') | third_party/WebKit/Source/core/layout/LayoutTableSection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698