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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 // FIXME: We should do this recalc lazily in borderStart/borderEnd so that w
e don't have to make sure | 430 // FIXME: We should do this recalc lazily in borderStart/borderEnd so that w
e don't have to make sure |
431 // to call this before we call borderStart/borderEnd to avoid getting a stal
e value. | 431 // to call this before we call borderStart/borderEnd to avoid getting a stal
e value. |
432 recalcBordersInRowDirection(); | 432 recalcBordersInRowDirection(); |
433 | 433 |
434 SubtreeLayoutScope layouter(*this); | 434 SubtreeLayoutScope layouter(*this); |
435 | 435 |
436 // If any table section moved vertically, we will just issue paint invalidat
ions for everything from that | 436 // If any table section moved vertically, we will just issue paint invalidat
ions for everything from that |
437 // section down (it is quite unlikely that any of the following sections | 437 // section down (it is quite unlikely that any of the following sections |
438 // did not shift). | 438 // did not shift). |
439 bool sectionMoved = false; | 439 bool sectionMoved = false; |
440 LayoutUnit movedSectionLogicalTop = 0; | |
441 { | 440 { |
442 LayoutState state(*this, locationOffset()); | 441 LayoutState state(*this, locationOffset()); |
443 LayoutUnit oldLogicalWidth = logicalWidth(); | 442 LayoutUnit oldLogicalWidth = logicalWidth(); |
444 LayoutUnit oldLogicalHeight = logicalHeight(); | 443 LayoutUnit oldLogicalHeight = logicalHeight(); |
445 | 444 |
446 setLogicalHeight(0); | 445 setLogicalHeight(0); |
447 updateLogicalWidth(); | 446 updateLogicalWidth(); |
448 | 447 |
449 if (logicalWidth() != oldLogicalWidth) { | 448 if (logicalWidth() != oldLogicalWidth) { |
450 for (unsigned i = 0; i < m_captions.size(); i++) | 449 for (unsigned i = 0; i < m_captions.size(); i++) |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 } | 486 } |
488 } | 487 } |
489 | 488 |
490 // FIXME: Collapse caption margin. | 489 // FIXME: Collapse caption margin. |
491 if (!m_captions.isEmpty()) { | 490 if (!m_captions.isEmpty()) { |
492 for (unsigned i = 0; i < m_captions.size(); i++) { | 491 for (unsigned i = 0; i < m_captions.size(); i++) { |
493 if (m_captions[i]->style()->captionSide() == CAPBOTTOM) | 492 if (m_captions[i]->style()->captionSide() == CAPBOTTOM) |
494 continue; | 493 continue; |
495 layoutCaption(*m_captions[i]); | 494 layoutCaption(*m_captions[i]); |
496 } | 495 } |
497 if (logicalHeight() != oldTableLogicalTop) { | 496 sectionMoved = logicalHeight() != oldTableLogicalTop; |
498 sectionMoved = true; | |
499 movedSectionLogicalTop = std::min(logicalHeight(), oldTableLogic
alTop); | |
500 } | |
501 } | 497 } |
502 | 498 |
503 LayoutUnit borderAndPaddingBefore = borderBefore() + (collapsing ? Layou
tUnit() : paddingBefore()); | 499 LayoutUnit borderAndPaddingBefore = borderBefore() + (collapsing ? Layou
tUnit() : paddingBefore()); |
504 LayoutUnit borderAndPaddingAfter = borderAfter() + (collapsing ? LayoutU
nit() : paddingAfter()); | 500 LayoutUnit borderAndPaddingAfter = borderAfter() + (collapsing ? LayoutU
nit() : paddingAfter()); |
505 | 501 |
506 setLogicalHeight(logicalHeight() + borderAndPaddingBefore); | 502 setLogicalHeight(logicalHeight() + borderAndPaddingBefore); |
507 | 503 |
508 LayoutUnit computedLogicalHeight = 0; | 504 LayoutUnit computedLogicalHeight = 0; |
509 | 505 |
510 Length logicalHeightLength = style()->logicalHeight(); | 506 Length logicalHeightLength = style()->logicalHeight(); |
(...skipping 23 matching lines...) Expand all Loading... |
534 setLogicalHeight(logicalHeight() + computedLogicalHeight); | 530 setLogicalHeight(logicalHeight() + computedLogicalHeight); |
535 } | 531 } |
536 | 532 |
537 LayoutUnit sectionLogicalLeft = style()->isLeftToRightDirection() ? bord
erStart() : borderEnd(); | 533 LayoutUnit sectionLogicalLeft = style()->isLeftToRightDirection() ? bord
erStart() : borderEnd(); |
538 if (!collapsing) | 534 if (!collapsing) |
539 sectionLogicalLeft += style()->isLeftToRightDirection() ? paddingSta
rt() : paddingEnd(); | 535 sectionLogicalLeft += style()->isLeftToRightDirection() ? paddingSta
rt() : paddingEnd(); |
540 | 536 |
541 // position the table sections | 537 // position the table sections |
542 LayoutTableSection* section = topSection(); | 538 LayoutTableSection* section = topSection(); |
543 while (section) { | 539 while (section) { |
544 if (!sectionMoved && section->logicalTop() != logicalHeight()) { | 540 if (!sectionMoved && section->logicalTop() != logicalHeight()) |
545 sectionMoved = true; | 541 sectionMoved = true; |
546 movedSectionLogicalTop = std::min(logicalHeight(), section->logi
calTop()) + (style()->isHorizontalWritingMode() ? section->visualOverflowRect().
y() : section->visualOverflowRect().x()); | |
547 } | |
548 section->setLogicalLocation(LayoutPoint(sectionLogicalLeft, logicalH
eight())); | 542 section->setLogicalLocation(LayoutPoint(sectionLogicalLeft, logicalH
eight())); |
549 | 543 |
550 // As we may skip invalidation on the table, we need to ensure that
sections are invalidated when they moved. | 544 // As we may skip invalidation on the table, we need to ensure that
sections are invalidated when they moved. |
551 if (sectionMoved && !section->selfNeedsLayout()) | 545 if (sectionMoved && !section->selfNeedsLayout()) |
552 section->setMayNeedPaintInvalidation(); | 546 section->setMayNeedPaintInvalidation(); |
553 | 547 |
554 setLogicalHeight(logicalHeight() + section->logicalHeight()); | 548 setLogicalHeight(logicalHeight() + section->logicalHeight()); |
555 | 549 |
556 section->updateLayerTransformAfterLayout(); | 550 section->updateLayerTransformAfterLayout(); |
557 section->addVisualEffectOverflow(); | 551 section->addVisualEffectOverflow(); |
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1415 || row->shouldDoFullPaintInvalidation()) | 1409 || row->shouldDoFullPaintInvalidation()) |
1416 cell->invalidateDisplayItemClient(*cell); | 1410 cell->invalidateDisplayItemClient(*cell); |
1417 } | 1411 } |
1418 } | 1412 } |
1419 } | 1413 } |
1420 | 1414 |
1421 LayoutBlock::invalidatePaintOfSubtreesIfNeeded(childPaintInvalidationState); | 1415 LayoutBlock::invalidatePaintOfSubtreesIfNeeded(childPaintInvalidationState); |
1422 } | 1416 } |
1423 | 1417 |
1424 } | 1418 } |
OLD | NEW |