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

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

Issue 2219153002: Offset repeating theads correctly when two tables adjoin at a page border (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bug 634404 Created 4 years, 4 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) 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. All rights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved.
8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
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 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 536
537 distributeExtraLogicalHeight(floorToInt(computedLogicalHeight - totalSec tionLogicalHeight)); 537 distributeExtraLogicalHeight(floorToInt(computedLogicalHeight - totalSec tionLogicalHeight));
538 538
539 bool isPaginated = view()->layoutState()->isPaginated(); 539 bool isPaginated = view()->layoutState()->isPaginated();
540 LayoutTableSection* topSection = this->topSection(); 540 LayoutTableSection* topSection = this->topSection();
541 LayoutUnit logicalOffset = topSection ? topSection->logicalTop() : Layou tUnit(); 541 LayoutUnit logicalOffset = topSection ? topSection->logicalTop() : Layou tUnit();
542 for (LayoutTableSection* section = topSection; section; section = sectio nBelow(section)) { 542 for (LayoutTableSection* section = topSection; section; section = sectio nBelow(section)) {
543 section->setLogicalTop(logicalOffset); 543 section->setLogicalTop(logicalOffset);
544 section->layoutRows(); 544 section->layoutRows();
545 logicalOffset += section->logicalHeight(); 545 logicalOffset += section->logicalHeight();
546 if (isPaginated && m_head && m_head == section && section->logicalHe ight() < section->pageLogicalHeightForOffset(logicalOffset)) { 546 // If the section is a repeating header group that allows at least o ne row of content then store the
547 // offset for other sections to offset their rows against.
548 if (isPaginated && m_head && m_head == section && section->logicalHe ight() < section->pageLogicalHeightForOffset(logicalOffset)
549 && section->getPaginationBreakability() != LayoutBox::AllowAnyBr eaks) {
547 LayoutUnit offsetForTableHeaders = state.heightOffsetForTableHea ders(); 550 LayoutUnit offsetForTableHeaders = state.heightOffsetForTableHea ders();
548 offsetForTableHeaders += section->logicalHeight(); 551 // Don't include any strut in the header group - we only want th e height from its content.
552 offsetForTableHeaders += section->logicalHeight() - section->pag inationStrutForRow(section->firstRow(), section->logicalTop());
mstensho (USE GERRIT) 2016/08/10 09:42:48 section->firstRow() may be nullptr.
549 state.setHeightOffsetForTableHeaders(offsetForTableHeaders); 553 state.setHeightOffsetForTableHeaders(offsetForTableHeaders);
550 } 554 }
551 } 555 }
552 556
553 if (!topSection && computedLogicalHeight > totalSectionLogicalHeight && !document().inQuirksMode()) { 557 if (!topSection && computedLogicalHeight > totalSectionLogicalHeight && !document().inQuirksMode()) {
554 // Completely empty tables (with no sections or anything) should at least honor specified height 558 // Completely empty tables (with no sections or anything) should at least honor specified height
555 // in strict mode. 559 // in strict mode.
556 setLogicalHeight(logicalHeight() + computedLogicalHeight); 560 setLogicalHeight(logicalHeight() + computedLogicalHeight);
557 } 561 }
558 562
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
1507 1511
1508 LayoutUnit LayoutTable::paddingRight() const 1512 LayoutUnit LayoutTable::paddingRight() const
1509 { 1513 {
1510 if (collapseBorders()) 1514 if (collapseBorders())
1511 return LayoutUnit(); 1515 return LayoutUnit();
1512 1516
1513 return LayoutBlock::paddingRight(); 1517 return LayoutBlock::paddingRight();
1514 } 1518 }
1515 1519
1516 } // namespace blink 1520 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698