| OLD | NEW |
| 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 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 } | 528 } |
| 529 | 529 |
| 530 Length logicalMinHeightLength = style()->logicalMinHeight(); | 530 Length logicalMinHeightLength = style()->logicalMinHeight(); |
| 531 if (logicalMinHeightLength.isIntrinsic() || (logicalMinHeightLength.isSp
ecified() && !logicalMinHeightLength.isNegative())) { | 531 if (logicalMinHeightLength.isIntrinsic() || (logicalMinHeightLength.isSp
ecified() && !logicalMinHeightLength.isNegative())) { |
| 532 LayoutUnit computedMinLogicalHeight = convertStyleLogicalHeightToCom
putedHeight(logicalMinHeightLength); | 532 LayoutUnit computedMinLogicalHeight = convertStyleLogicalHeightToCom
putedHeight(logicalMinHeightLength); |
| 533 computedLogicalHeight = std::max(computedLogicalHeight, computedMinL
ogicalHeight); | 533 computedLogicalHeight = std::max(computedLogicalHeight, computedMinL
ogicalHeight); |
| 534 } | 534 } |
| 535 | 535 |
| 536 distributeExtraLogicalHeight(floorToInt(computedLogicalHeight - totalSec
tionLogicalHeight)); | 536 distributeExtraLogicalHeight(floorToInt(computedLogicalHeight - totalSec
tionLogicalHeight)); |
| 537 | 537 |
| 538 for (LayoutTableSection* section = topSection(); section; section = sect
ionBelow(section)) | 538 LayoutTableSection* topSection = this->topSection(); |
| 539 LayoutUnit logicalOffset = topSection ? topSection->logicalTop() : Layou
tUnit(); |
| 540 for (LayoutTableSection* section = topSection; section; section = sectio
nBelow(section)) { |
| 541 section->setLogicalTop(logicalOffset); |
| 539 section->layoutRows(); | 542 section->layoutRows(); |
| 543 logicalOffset += section->logicalHeight(); |
| 544 } |
| 540 | 545 |
| 541 if (!topSection() && computedLogicalHeight > totalSectionLogicalHeight &
& !document().inQuirksMode()) { | 546 if (!topSection && computedLogicalHeight > totalSectionLogicalHeight &&
!document().inQuirksMode()) { |
| 542 // Completely empty tables (with no sections or anything) should at
least honor specified height | 547 // Completely empty tables (with no sections or anything) should at
least honor specified height |
| 543 // in strict mode. | 548 // in strict mode. |
| 544 setLogicalHeight(logicalHeight() + computedLogicalHeight); | 549 setLogicalHeight(logicalHeight() + computedLogicalHeight); |
| 545 } | 550 } |
| 546 | 551 |
| 547 LayoutUnit sectionLogicalLeft = LayoutUnit(style()->isLeftToRightDirecti
on() ? borderStart() : borderEnd()); | 552 LayoutUnit sectionLogicalLeft = LayoutUnit(style()->isLeftToRightDirecti
on() ? borderStart() : borderEnd()); |
| 548 if (!collapsing) | 553 if (!collapsing) |
| 549 sectionLogicalLeft += style()->isLeftToRightDirection() ? paddingSta
rt() : paddingEnd(); | 554 sectionLogicalLeft += style()->isLeftToRightDirection() ? paddingSta
rt() : paddingEnd(); |
| 550 | 555 |
| 551 // position the table sections | 556 // position the table sections |
| 552 LayoutTableSection* section = topSection(); | 557 LayoutTableSection* section = topSection; |
| 553 while (section) { | 558 while (section) { |
| 554 if (!sectionMoved && section->logicalTop() != logicalHeight()) | 559 if (!sectionMoved && section->logicalTop() != logicalHeight()) |
| 555 sectionMoved = true; | 560 sectionMoved = true; |
| 556 section->setLogicalLocation(LayoutPoint(sectionLogicalLeft, logicalH
eight())); | 561 section->setLogicalLocation(LayoutPoint(sectionLogicalLeft, logicalH
eight())); |
| 557 | 562 |
| 558 // As we may skip invalidation on the table, we need to ensure that
sections are invalidated when they moved. | 563 // As we may skip invalidation on the table, we need to ensure that
sections are invalidated when they moved. |
| 559 if (sectionMoved && !section->selfNeedsLayout()) | 564 if (sectionMoved && !section->selfNeedsLayout()) |
| 560 section->setMayNeedPaintInvalidation(); | 565 section->setMayNeedPaintInvalidation(); |
| 561 | 566 |
| 562 setLogicalHeight(logicalHeight() + section->logicalHeight()); | 567 setLogicalHeight(logicalHeight() + section->logicalHeight()); |
| (...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1495 | 1500 |
| 1496 LayoutUnit LayoutTable::paddingRight() const | 1501 LayoutUnit LayoutTable::paddingRight() const |
| 1497 { | 1502 { |
| 1498 if (collapseBorders()) | 1503 if (collapseBorders()) |
| 1499 return LayoutUnit(); | 1504 return LayoutUnit(); |
| 1500 | 1505 |
| 1501 return LayoutBlock::paddingRight(); | 1506 return LayoutBlock::paddingRight(); |
| 1502 } | 1507 } |
| 1503 | 1508 |
| 1504 } // namespace blink | 1509 } // namespace blink |
| OLD | NEW |