Chromium Code Reviews| 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, 2008, 2009, 2010 Apple Inc. All rights reserved. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010 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 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 466 } | 466 } |
| 467 | 467 |
| 468 // Find out the baseline of the cell | 468 // Find out the baseline of the cell |
| 469 // If the cell's baseline is more then the row's baseline then the cell's baseli ne become the row's baseline | 469 // If the cell's baseline is more then the row's baseline then the cell's baseli ne become the row's baseline |
| 470 // and if the row's baseline goes out of the row's boundries then adjust row hei ght accordingly. | 470 // and if the row's baseline goes out of the row's boundries then adjust row hei ght accordingly. |
| 471 void RenderTableSection::updateBaselineForCell(RenderTableCell* cell, unsigned r ow, LayoutUnit& baselineDescent) | 471 void RenderTableSection::updateBaselineForCell(RenderTableCell* cell, unsigned r ow, LayoutUnit& baselineDescent) |
| 472 { | 472 { |
| 473 if (!cell->isBaselineAligned()) | 473 if (!cell->isBaselineAligned()) |
| 474 return; | 474 return; |
| 475 | 475 |
| 476 LayoutUnit baselinePosition = cell->cellBaselinePosition(); | 476 // Calculating the row's baseline excluding intrinsic padding because row's baseline will come into it's right |
|
Julien - ping for review
2013/08/08 22:15:51
s/it's/its/ :(
| |
| 477 if (baselinePosition > cell->borderBefore() + cell->paddingBefore()) { | 477 // position when row's baseline would be calculated for the cell which intro duced intrinsic padding for other cells. |
|
Julien - ping for review
2013/08/08 22:15:51
Let's try to make comment good English sentence. T
suchit.agrawal
2013/08/09 11:00:43
Done.
| |
| 478 LayoutUnit baselinePosition = cell->cellBaselinePosition() - cell->intrinsic PaddingBefore(); | |
| 479 if (baselinePosition > cell->borderBefore() + (cell->paddingBefore() - cell- >intrinsicPaddingBefore())) { | |
| 478 m_grid[row].baseline = max(m_grid[row].baseline, baselinePosition); | 480 m_grid[row].baseline = max(m_grid[row].baseline, baselinePosition); |
| 479 | 481 |
| 480 int cellStartRowBaselineDescent = 0; | 482 int cellStartRowBaselineDescent = 0; |
| 481 if (cell->rowSpan() == 1) { | 483 if (cell->rowSpan() == 1) { |
| 482 baselineDescent = max(baselineDescent, cell->logicalHeightForRowSizi ng() - (baselinePosition - cell->intrinsicPaddingBefore())); | 484 baselineDescent = max(baselineDescent, cell->logicalHeightForRowSizi ng() - baselinePosition); |
| 483 cellStartRowBaselineDescent = baselineDescent; | 485 cellStartRowBaselineDescent = baselineDescent; |
| 484 } | 486 } |
| 485 m_rowPos[row + 1] = max<int>(m_rowPos[row + 1], m_rowPos[row] + m_grid[r ow].baseline + cellStartRowBaselineDescent); | 487 m_rowPos[row + 1] = max<int>(m_rowPos[row + 1], m_rowPos[row] + m_grid[r ow].baseline + cellStartRowBaselineDescent); |
| 486 } | 488 } |
| 487 } | 489 } |
| 488 | 490 |
| 489 int RenderTableSection::calcRowLogicalHeight() | 491 int RenderTableSection::calcRowLogicalHeight() |
| 490 { | 492 { |
| 491 #ifndef NDEBUG | 493 #ifndef NDEBUG |
| 492 SetLayoutNeededForbiddenScope layoutForbiddenScope(this); | 494 SetLayoutNeededForbiddenScope layoutForbiddenScope(this); |
| (...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1675 if (!style()->isLeftToRightDirection()) | 1677 if (!style()->isLeftToRightDirection()) |
| 1676 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing); | 1678 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing); |
| 1677 else | 1679 else |
| 1678 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing); | 1680 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing); |
| 1679 | 1681 |
| 1680 cell->setLogicalLocation(cellLocation); | 1682 cell->setLogicalLocation(cellLocation); |
| 1681 view()->addLayoutDelta(oldCellLocation - cell->location()); | 1683 view()->addLayoutDelta(oldCellLocation - cell->location()); |
| 1682 } | 1684 } |
| 1683 | 1685 |
| 1684 } // namespace WebCore | 1686 } // namespace WebCore |
| OLD | NEW |