Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutTableSection.cpp

Issue 2366193002: Fix paint invalidation rects for repeating paginated table headers. (Closed)
Patch Set: Created 4 years, 2 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, 2008, 2009, 2010, 2013 Apple Inc. All r ights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2013 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 1672 matching lines...) Expand 10 before | Expand all | Expand 10 after
1683 1683
1684 // FIXME: The table's direction should determine our row's direction, not th e section's (see bug 96691). 1684 // FIXME: The table's direction should determine our row's direction, not th e section's (see bug 96691).
1685 if (!style()->isLeftToRightDirection()) 1685 if (!style()->isLeftToRightDirection())
1686 cellLocation.setX(LayoutUnit(table()->effectiveColumnPositions()[table() ->numEffectiveColumns()] - table()->effectiveColumnPositions()[table()->absolute ColumnToEffectiveColumn(cell->absoluteColumnIndex() + cell->colSpan())] + horizo ntalBorderSpacing)); 1686 cellLocation.setX(LayoutUnit(table()->effectiveColumnPositions()[table() ->numEffectiveColumns()] - table()->effectiveColumnPositions()[table()->absolute ColumnToEffectiveColumn(cell->absoluteColumnIndex() + cell->colSpan())] + horizo ntalBorderSpacing));
1687 else 1687 else
1688 cellLocation.setX(LayoutUnit(table()->effectiveColumnPositions()[effecti veColumn] + horizontalBorderSpacing)); 1688 cellLocation.setX(LayoutUnit(table()->effectiveColumnPositions()[effecti veColumn] + horizontalBorderSpacing));
1689 1689
1690 cell->setLogicalLocation(cellLocation); 1690 cell->setLogicalLocation(cellLocation);
1691 } 1691 }
1692 1692
1693 bool LayoutTableSection::hasRepeatingHeaderGroup() const
1694 {
1695 if (getPaginationBreakability() == LayoutBox::AllowAnyBreaks)
1696 return false;
1697 // TODO(rhogan): Should we paint a header repeatedly if it's self-painting?
1698 if (hasSelfPaintingLayer())
1699 return false;
1700 LayoutUnit pageHeight = table()->pageLogicalHeightForOffset(LayoutUnit());
1701 if (!pageHeight)
1702 return false;
1703 return true;
1704 }
1705
1706 bool LayoutTableSection::mapToVisualRectInAncestorSpace(const LayoutBoxModelObje ct* ancestor, LayoutRect& rect, VisualRectFlags flags) const
1707 {
1708 if (ancestor == this)
1709 return true;
1710 // Repeating table headers are painted once per fragmentation page/column. T his does not go through the regular fragmentation machinery,
1711 // so we need special code to expand the invalidation rect to contain all po sitions of the header in all columns.
1712 // Note that this is in flow thread coordinates, not visual coordinates. The enclosing LayoutFlowThread will convert to visual coordinates.
1713 if (table()->header() == this && hasRepeatingHeaderGroup())
1714 rect.setHeight(table()->logicalHeight());
1715 return LayoutTableBoxComponent::mapToVisualRectInAncestorSpace(ancestor, rec t, flags);
1716 }
1717
1718
1693 } // namespace blink 1719 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698