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

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

Issue 1676933004: Table cell background painting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: colgroup paint bug125336 fix Created 4 years, 10 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 1629 matching lines...) Expand 10 before | Expand all | Expand 10 after
1640 1640
1641 // FIXME: The table's direction should determine our row's direction, not th e section's (see bug 96691). 1641 // FIXME: The table's direction should determine our row's direction, not th e section's (see bug 96691).
1642 if (!style()->isLeftToRightDirection()) 1642 if (!style()->isLeftToRightDirection())
1643 cellLocation.setX(LayoutUnit(table()->columnPositions()[table()->numEffC ols()] - table()->columnPositions()[table()->colToEffCol(cell->col() + cell->col Span())] + horizontalBorderSpacing)); 1643 cellLocation.setX(LayoutUnit(table()->columnPositions()[table()->numEffC ols()] - table()->columnPositions()[table()->colToEffCol(cell->col() + cell->col Span())] + horizontalBorderSpacing));
1644 else 1644 else
1645 cellLocation.setX(LayoutUnit(table()->columnPositions()[effectiveColumn] + horizontalBorderSpacing)); 1645 cellLocation.setX(LayoutUnit(table()->columnPositions()[effectiveColumn] + horizontalBorderSpacing));
1646 1646
1647 cell->setLogicalLocation(cellLocation); 1647 cell->setLogicalLocation(cellLocation);
1648 } 1648 }
1649 1649
1650 LayoutRect LayoutTableSection::positionByCellSpan() const
1651 {
1652 LayoutRect position;
1653 LayoutTableRow* firstRow = this->firstRow();
1654 LayoutTableRow* lastRow = this->lastRow();
1655 if (firstRow && lastRow) {
1656 position = firstRow->positionByCellSpan();
1657 position.unite(lastRow->positionByCellSpan());
1658 }
1659 return position;
1660 }
1661
1662 // Ideal cell is a cell that spans single row/column.
1663 // It is used to calculate position of colgroup/col/row
1664 // It is needed because actual cells can be arbitrary rectangles, or non-existen t
1665 LayoutRect LayoutTableSection::positionOfIdealCell(unsigned row, unsigned col) c onst
1666 {
1667 LayoutRect position;
1668 LayoutTable * table = this->table();
1669 unsigned left = table->columnPositions()[col];
1670 unsigned top = m_rowPos[row];
1671 unsigned right = table->columnPositions()[col+1];
1672 unsigned bottom = m_rowPos[row+1];
1673 left += table->hBorderSpacing();
1674 return LayoutRect(LayoutPoint(left, top), LayoutSize(right - left, bottom-to p));
1675 }
1650 } // namespace blink 1676 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698