| 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. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. |
| 8 * All rights reserved. | 8 * All rights reserved. |
| 9 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 9 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 10 * | 10 * |
| (...skipping 1655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1666 ASSERT(cell->isFirstOrLastCellInRow()); | 1666 ASSERT(cell->isFirstOrLastCellInRow()); |
| 1667 if (hasSameDirectionAs(cell->row())) | 1667 if (hasSameDirectionAs(cell->row())) |
| 1668 return style()->borderEnd(); | 1668 return style()->borderEnd(); |
| 1669 | 1669 |
| 1670 return style()->borderStart(); | 1670 return style()->borderStart(); |
| 1671 } | 1671 } |
| 1672 | 1672 |
| 1673 void LayoutTable::ensureIsReadyForPaintInvalidation() { | 1673 void LayoutTable::ensureIsReadyForPaintInvalidation() { |
| 1674 LayoutBlock::ensureIsReadyForPaintInvalidation(); | 1674 LayoutBlock::ensureIsReadyForPaintInvalidation(); |
| 1675 recalcCollapsedBordersIfNeeded(); | 1675 recalcCollapsedBordersIfNeeded(); |
| 1676 |
| 1677 bool hasColBackground = false; |
| 1678 for (LayoutTableCol* col = firstColumn(); col; col = col->nextColumn()) { |
| 1679 if (col->styleRef().hasBackground()) { |
| 1680 hasColBackground = true; |
| 1681 break; |
| 1682 } |
| 1683 } |
| 1684 |
| 1685 for (LayoutObject* child = firstChild(); child; |
| 1686 child = child->nextSibling()) { |
| 1687 if (!child->isTableSection()) |
| 1688 continue; |
| 1689 LayoutTableSection* section = toLayoutTableSection(child); |
| 1690 if (section->isPaintInvalidationContainer()) { |
| 1691 section->m_rareStat.addReason(ReasonLTSComposited); |
| 1692 if (hasColBackground) { |
| 1693 section->m_rareStat.addReason( |
| 1694 ReasonLTSCompositedWithContainerBackground); |
| 1695 } |
| 1696 } else { |
| 1697 section->m_rareStat.addReason(ReasonLTSNonComposited); |
| 1698 } |
| 1699 bool hasSectionBackground = section->styleRef().hasBackground(); |
| 1700 for (LayoutTableRow* row = section->firstRow(); row; row = row->nextRow()) { |
| 1701 if (row->isPaintInvalidationContainer()) { |
| 1702 row->m_rareStat.addReason(ReasonLTRComposited); |
| 1703 if (hasSectionBackground || hasColBackground) |
| 1704 row->m_rareStat.addReason(ReasonLTRCompositedWithContainerBackground); |
| 1705 } else { |
| 1706 row->m_rareStat.addReason(ReasonLTRNonComposited); |
| 1707 } |
| 1708 bool hasRowBackground = row->styleRef().hasBackground(); |
| 1709 for (LayoutTableCell* cell = row->firstCell(); cell; |
| 1710 cell = cell->nextCell()) { |
| 1711 if (cell->isPaintInvalidationContainer()) { |
| 1712 cell->m_rareStat.addReason(ReasonLTCComposited); |
| 1713 ColAndColGroup colAndColGroup = |
| 1714 colElementAtAbsoluteColumn(cell->absoluteColumnIndex()); |
| 1715 LayoutTableCol* column = colAndColGroup.col; |
| 1716 LayoutTableCol* columnGroup = colAndColGroup.colgroup; |
| 1717 if ((column && column->styleRef().hasBackground()) || |
| 1718 (columnGroup && columnGroup->styleRef().hasBackground()) || |
| 1719 hasSectionBackground || hasRowBackground) { |
| 1720 cell->m_rareStat.addReason( |
| 1721 ReasonLTCCompositedWithContainerBackground); |
| 1722 } |
| 1723 } else { |
| 1724 cell->m_rareStat.addReason(ReasonLTCNonComposited); |
| 1725 } |
| 1726 } |
| 1727 } |
| 1728 } |
| 1676 } | 1729 } |
| 1677 | 1730 |
| 1678 PaintInvalidationReason LayoutTable::invalidatePaintIfNeeded( | 1731 PaintInvalidationReason LayoutTable::invalidatePaintIfNeeded( |
| 1679 const PaintInvalidationState& paintInvalidationState) { | 1732 const PaintInvalidationState& paintInvalidationState) { |
| 1680 if (collapseBorders() && !m_collapsedBorders.isEmpty()) | 1733 if (collapseBorders() && !m_collapsedBorders.isEmpty()) |
| 1681 paintInvalidationState.paintingLayer() | 1734 paintInvalidationState.paintingLayer() |
| 1682 .setNeedsPaintPhaseDescendantBlockBackgrounds(); | 1735 .setNeedsPaintPhaseDescendantBlockBackgrounds(); |
| 1683 | 1736 |
| 1684 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); | 1737 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); |
| 1685 } | 1738 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1711 } | 1764 } |
| 1712 | 1765 |
| 1713 LayoutUnit LayoutTable::paddingRight() const { | 1766 LayoutUnit LayoutTable::paddingRight() const { |
| 1714 if (collapseBorders()) | 1767 if (collapseBorders()) |
| 1715 return LayoutUnit(); | 1768 return LayoutUnit(); |
| 1716 | 1769 |
| 1717 return LayoutBlock::paddingRight(); | 1770 return LayoutBlock::paddingRight(); |
| 1718 } | 1771 } |
| 1719 | 1772 |
| 1720 } // namespace blink | 1773 } // namespace blink |
| OLD | NEW |