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 2079603002: Handle nested theads correctly when paginated (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bug 620456 Created 4 years, 5 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 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 } 529 }
530 530
531 Length logicalMinHeightLength = style()->logicalMinHeight(); 531 Length logicalMinHeightLength = style()->logicalMinHeight();
532 if (logicalMinHeightLength.isIntrinsic() || (logicalMinHeightLength.isSp ecified() && !logicalMinHeightLength.isNegative())) { 532 if (logicalMinHeightLength.isIntrinsic() || (logicalMinHeightLength.isSp ecified() && !logicalMinHeightLength.isNegative())) {
533 LayoutUnit computedMinLogicalHeight = convertStyleLogicalHeightToCom putedHeight(logicalMinHeightLength); 533 LayoutUnit computedMinLogicalHeight = convertStyleLogicalHeightToCom putedHeight(logicalMinHeightLength);
534 computedLogicalHeight = std::max(computedLogicalHeight, computedMinL ogicalHeight); 534 computedLogicalHeight = std::max(computedLogicalHeight, computedMinL ogicalHeight);
535 } 535 }
536 536
537 distributeExtraLogicalHeight(floorToInt(computedLogicalHeight - totalSec tionLogicalHeight)); 537 distributeExtraLogicalHeight(floorToInt(computedLogicalHeight - totalSec tionLogicalHeight));
538 538
539 bool isPaginated = view()->layoutState()->isPaginated();
539 LayoutTableSection* topSection = this->topSection(); 540 LayoutTableSection* topSection = this->topSection();
540 LayoutUnit logicalOffset = topSection ? topSection->logicalTop() : Layou tUnit(); 541 LayoutUnit logicalOffset = topSection ? topSection->logicalTop() : Layou tUnit();
541 for (LayoutTableSection* section = topSection; section; section = sectio nBelow(section)) { 542 for (LayoutTableSection* section = topSection; section; section = sectio nBelow(section)) {
542 section->setLogicalTop(logicalOffset); 543 section->setLogicalTop(logicalOffset);
543 section->layoutRows(); 544 section->layoutRows();
544 logicalOffset += section->logicalHeight(); 545 logicalOffset += section->logicalHeight();
546 if (isPaginated && m_head && m_head == section) {
547 LayoutUnit offsetForTableHeaders = state.heightOffsetForTableHea ders();
548 offsetForTableHeaders += section->logicalHeight();
549 state.setHeightOffsetForTableHeaders(offsetForTableHeaders);
550 }
545 } 551 }
546 552
547 if (!topSection && computedLogicalHeight > totalSectionLogicalHeight && !document().inQuirksMode()) { 553 if (!topSection && computedLogicalHeight > totalSectionLogicalHeight && !document().inQuirksMode()) {
548 // Completely empty tables (with no sections or anything) should at least honor specified height 554 // Completely empty tables (with no sections or anything) should at least honor specified height
549 // in strict mode. 555 // in strict mode.
550 setLogicalHeight(logicalHeight() + computedLogicalHeight); 556 setLogicalHeight(logicalHeight() + computedLogicalHeight);
551 } 557 }
552 558
553 LayoutUnit sectionLogicalLeft = LayoutUnit(style()->isLeftToRightDirecti on() ? borderStart() : borderEnd()); 559 LayoutUnit sectionLogicalLeft = LayoutUnit(style()->isLeftToRightDirecti on() ? borderStart() : borderEnd());
554 if (!collapsing) 560 if (!collapsing)
(...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after
1501 1507
1502 LayoutUnit LayoutTable::paddingRight() const 1508 LayoutUnit LayoutTable::paddingRight() const
1503 { 1509 {
1504 if (collapseBorders()) 1510 if (collapseBorders())
1505 return LayoutUnit(); 1511 return LayoutUnit();
1506 1512
1507 return LayoutBlock::paddingRight(); 1513 return LayoutBlock::paddingRight();
1508 } 1514 }
1509 1515
1510 } // namespace blink 1516 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutState.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutTableSection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698