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 Apple Inc. All r
ights reserved. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r
ights 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 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 for (RenderTableSection* section = topSection(); section; section = sectionB
elow(section)) | 619 for (RenderTableSection* section = topSection(); section; section = sectionB
elow(section)) |
620 addOverflowFromChild(section); | 620 addOverflowFromChild(section); |
621 } | 621 } |
622 | 622 |
623 void RenderTable::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset) | 623 void RenderTable::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset) |
624 { | 624 { |
625 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, this); | 625 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, this); |
626 | 626 |
627 LayoutPoint adjustedPaintOffset = paintOffset + location(); | 627 LayoutPoint adjustedPaintOffset = paintOffset + location(); |
628 | 628 |
629 PaintPhase paintPhase = paintInfo.phase; | 629 PaintPhase paintPhase = paintInfo.getPhase(); |
630 | 630 |
631 if (!isRoot()) { | 631 if (!isRoot()) { |
632 LayoutRect overflowBox = visualOverflowRect(); | 632 LayoutRect overflowBox = visualOverflowRect(); |
633 flipForWritingMode(overflowBox); | 633 flipForWritingMode(overflowBox); |
634 overflowBox.inflate(maximalOutlineSize(paintInfo.phase)); | 634 overflowBox.inflate(maximalOutlineSize(paintInfo.getPhase())); |
635 overflowBox.moveBy(adjustedPaintOffset); | 635 overflowBox.moveBy(adjustedPaintOffset); |
636 if (!overflowBox.intersects(paintInfo.rect)) | 636 if (!overflowBox.intersects(paintInfo.getRect())) |
637 return; | 637 return; |
638 } | 638 } |
639 | 639 |
640 bool pushedClip = pushContentsClip(paintInfo, adjustedPaintOffset); | 640 bool pushedClip = pushContentsClip(paintInfo, adjustedPaintOffset); |
641 paintObject(paintInfo, adjustedPaintOffset); | 641 paintObject(paintInfo, adjustedPaintOffset); |
642 if (pushedClip) | 642 if (pushedClip) |
643 popContentsClip(paintInfo, paintPhase, adjustedPaintOffset); | 643 popContentsClip(paintInfo, paintPhase, adjustedPaintOffset); |
644 } | 644 } |
645 | 645 |
646 void RenderTable::paintObject(PaintInfo& paintInfo, const LayoutPoint& paintOffs
et) | 646 void RenderTable::paintObject(PaintInfo& paintInfo, const LayoutPoint& paintOffs
et) |
647 { | 647 { |
648 PaintPhase paintPhase = paintInfo.phase; | 648 PaintPhase paintPhase = paintInfo.getPhase(); |
649 if ((paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChil
dBlockBackground) && hasBoxDecorations() && style()->visibility() == VISIBLE) | 649 if ((paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChil
dBlockBackground) && hasBoxDecorations() && style()->visibility() == VISIBLE) |
650 paintBoxDecorations(paintInfo, paintOffset); | 650 paintBoxDecorations(paintInfo, paintOffset); |
651 | 651 |
652 if (paintPhase == PaintPhaseMask) { | 652 if (paintPhase == PaintPhaseMask) { |
653 paintMask(paintInfo, paintOffset); | 653 paintMask(paintInfo, paintOffset); |
654 return; | 654 return; |
655 } | 655 } |
656 | 656 |
657 // We're done. We don't bother painting any children. | 657 // We're done. We don't bother painting any children. |
658 if (paintPhase == PaintPhaseBlockBackground) | 658 if (paintPhase == PaintPhaseBlockBackground) |
659 return; | 659 return; |
660 | 660 |
661 // We don't paint our own background, but we do let the kids paint their bac
kgrounds. | 661 // We don't paint our own background, but we do let the kids paint their bac
kgrounds. |
662 if (paintPhase == PaintPhaseChildBlockBackgrounds) | 662 if (paintPhase == PaintPhaseChildBlockBackgrounds) |
663 paintPhase = PaintPhaseChildBlockBackground; | 663 paintPhase = PaintPhaseChildBlockBackground; |
664 | 664 |
665 PaintInfo info(paintInfo); | 665 PaintInfo info(paintInfo); |
666 info.phase = paintPhase; | 666 info.setPhase(paintPhase); |
667 info.updatePaintingRootForChildren(this); | 667 info.updatePaintingRootForChildren(this); |
668 | 668 |
669 for (RenderObject* child = firstChild(); child; child = child->nextSibling()
) { | 669 for (RenderObject* child = firstChild(); child; child = child->nextSibling()
) { |
670 if (child->isBox() && !toRenderBox(child)->hasSelfPaintingLayer() && (ch
ild->isTableSection() || child->isTableCaption())) { | 670 if (child->isBox() && !toRenderBox(child)->hasSelfPaintingLayer() && (ch
ild->isTableSection() || child->isTableCaption())) { |
671 LayoutPoint childPoint = flipForWritingModeForChild(toRenderBox(chil
d), paintOffset); | 671 LayoutPoint childPoint = flipForWritingModeForChild(toRenderBox(chil
d), paintOffset); |
672 child->paint(info, childPoint); | 672 child->paint(info, childPoint); |
673 } | 673 } |
674 } | 674 } |
675 | 675 |
676 if (collapseBorders() && paintPhase == PaintPhaseChildBlockBackground && sty
le()->visibility() == VISIBLE) { | 676 if (collapseBorders() && paintPhase == PaintPhaseChildBlockBackground && sty
le()->visibility() == VISIBLE) { |
677 recalcCollapsedBorders(); | 677 recalcCollapsedBorders(); |
678 // Using our cached sorted styles, we then do individual passes, | 678 // Using our cached sorted styles, we then do individual passes, |
679 // painting each style of border from lowest precedence to highest prece
dence. | 679 // painting each style of border from lowest precedence to highest prece
dence. |
680 info.phase = PaintPhaseCollapsedTableBorders; | 680 info.setPhase(PaintPhaseCollapsedTableBorders); |
681 size_t count = m_collapsedBorders.size(); | 681 size_t count = m_collapsedBorders.size(); |
682 for (size_t i = 0; i < count; ++i) { | 682 for (size_t i = 0; i < count; ++i) { |
683 m_currentBorder = &m_collapsedBorders[i]; | 683 m_currentBorder = &m_collapsedBorders[i]; |
684 for (RenderTableSection* section = bottomSection(); section; section
= sectionAbove(section)) { | 684 for (RenderTableSection* section = bottomSection(); section; section
= sectionAbove(section)) { |
685 LayoutPoint childPoint = flipForWritingModeForChild(section, pai
ntOffset); | 685 LayoutPoint childPoint = flipForWritingModeForChild(section, pai
ntOffset); |
686 section->paint(info, childPoint); | 686 section->paint(info, childPoint); |
687 } | 687 } |
688 } | 688 } |
689 m_currentBorder = 0; | 689 m_currentBorder = 0; |
690 } | 690 } |
(...skipping 21 matching lines...) Expand all Loading... |
712 } | 712 } |
713 | 713 |
714 void RenderTable::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint& p
aintOffset) | 714 void RenderTable::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint& p
aintOffset) |
715 { | 715 { |
716 if (!paintInfo.shouldPaintWithinRoot(this)) | 716 if (!paintInfo.shouldPaintWithinRoot(this)) |
717 return; | 717 return; |
718 | 718 |
719 LayoutRect rect(paintOffset, size()); | 719 LayoutRect rect(paintOffset, size()); |
720 subtractCaptionRect(rect); | 720 subtractCaptionRect(rect); |
721 | 721 |
722 BackgroundBleedAvoidance bleedAvoidance = determineBackgroundBleedAvoidance(
paintInfo.context); | 722 BackgroundBleedAvoidance bleedAvoidance = determineBackgroundBleedAvoidance(
paintInfo.getContext()); |
723 if (!boxShadowShouldBeAppliedToBackground(bleedAvoidance)) | 723 if (!boxShadowShouldBeAppliedToBackground(bleedAvoidance)) |
724 paintBoxShadow(paintInfo, rect, style(), Normal); | 724 paintBoxShadow(paintInfo, rect, style(), Normal); |
725 paintBackground(paintInfo, rect, bleedAvoidance); | 725 paintBackground(paintInfo, rect, bleedAvoidance); |
726 paintBoxShadow(paintInfo, rect, style(), Inset); | 726 paintBoxShadow(paintInfo, rect, style(), Inset); |
727 | 727 |
728 if (style()->hasBorder() && !collapseBorders()) | 728 if (style()->hasBorder() && !collapseBorders()) |
729 paintBorder(paintInfo, rect, style()); | 729 paintBorder(paintInfo, rect, style()); |
730 } | 730 } |
731 | 731 |
732 void RenderTable::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset
) | 732 void RenderTable::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset
) |
733 { | 733 { |
734 if (style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask) | 734 if (style()->visibility() != VISIBLE || paintInfo.getPhase() != PaintPhaseMa
sk) |
735 return; | 735 return; |
736 | 736 |
737 LayoutRect rect(paintOffset, size()); | 737 LayoutRect rect(paintOffset, size()); |
738 subtractCaptionRect(rect); | 738 subtractCaptionRect(rect); |
739 | 739 |
740 paintMaskImages(paintInfo, rect); | 740 paintMaskImages(paintInfo, rect); |
741 } | 741 } |
742 | 742 |
743 void RenderTable::computeIntrinsicLogicalWidths(LayoutUnit& minWidth, LayoutUnit
& maxWidth) const | 743 void RenderTable::computeIntrinsicLogicalWidths(LayoutUnit& minWidth, LayoutUnit
& maxWidth) const |
744 { | 744 { |
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1439 const BorderValue& RenderTable::tableEndBorderAdjoiningCell(const RenderTableCel
l* cell) const | 1439 const BorderValue& RenderTable::tableEndBorderAdjoiningCell(const RenderTableCel
l* cell) const |
1440 { | 1440 { |
1441 ASSERT(cell->isFirstOrLastCellInRow()); | 1441 ASSERT(cell->isFirstOrLastCellInRow()); |
1442 if (hasSameDirectionAs(cell->row())) | 1442 if (hasSameDirectionAs(cell->row())) |
1443 return style()->borderEnd(); | 1443 return style()->borderEnd(); |
1444 | 1444 |
1445 return style()->borderStart(); | 1445 return style()->borderStart(); |
1446 } | 1446 } |
1447 | 1447 |
1448 } | 1448 } |
OLD | NEW |