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

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

Issue 2701993002: DO NOT COMMIT: Results of running new (proposed) clang-format on Blink (Closed)
Patch Set: Created 3 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. 7 * Copyright (C) 2003, 2004, 2005, 2006, 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 unsigned insertionRow = row->rowIndex(); 252 unsigned insertionRow = row->rowIndex();
253 253
254 // ### mozilla still seems to do the old HTML way, even for strict DTD 254 // ### mozilla still seems to do the old HTML way, even for strict DTD
255 // (see the annotation on table cell layouting in the CSS specs and the 255 // (see the annotation on table cell layouting in the CSS specs and the
256 // testcase below: 256 // testcase below:
257 // <TABLE border> 257 // <TABLE border>
258 // <TR><TD>1 <TD rowspan="2">2 <TD>3 <TD>4 258 // <TR><TD>1 <TD rowspan="2">2 <TD>3 <TD>4
259 // <TR><TD colspan="2">5 259 // <TR><TD colspan="2">5
260 // </TABLE> 260 // </TABLE>
261 unsigned nCols = numCols(insertionRow); 261 unsigned nCols = numCols(insertionRow);
262 while (m_cCol < nCols && (cellAt(insertionRow, m_cCol).hasCells() || 262 while (m_cCol < nCols &&
263 cellAt(insertionRow, m_cCol).inColSpan)) 263 (cellAt(insertionRow, m_cCol).hasCells() ||
264 cellAt(insertionRow, m_cCol).inColSpan))
264 m_cCol++; 265 m_cCol++;
265 266
266 updateLogicalHeightForCell(m_grid[insertionRow], cell); 267 updateLogicalHeightForCell(m_grid[insertionRow], cell);
267 268
268 ensureRows(insertionRow + rSpan); 269 ensureRows(insertionRow + rSpan);
269 270
270 m_grid[insertionRow].rowLayoutObject = row; 271 m_grid[insertionRow].rowLayoutObject = row;
271 272
272 unsigned col = m_cCol; 273 unsigned col = m_cCol;
273 // tell the cell where it is 274 // tell the cell where it is
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 borderSpacingForRow(endRow - 1); 582 borderSpacingForRow(endRow - 1);
582 583
583 totalRowspanCellHeight += accumulatedCellPositionIncrease; 584 totalRowspanCellHeight += accumulatedCellPositionIncrease;
584 if (rowToApplyExtraHeight >= cellRowIndex && rowToApplyExtraHeight < endRow) 585 if (rowToApplyExtraHeight >= cellRowIndex && rowToApplyExtraHeight < endRow)
585 totalRowspanCellHeight += extraTableHeightToPropgate; 586 totalRowspanCellHeight += extraTableHeightToPropgate;
586 587
587 if (totalRowspanCellHeight < cell->logicalHeightForRowSizing()) { 588 if (totalRowspanCellHeight < cell->logicalHeightForRowSizing()) {
588 unsigned extraHeightRequired = 589 unsigned extraHeightRequired =
589 cell->logicalHeightForRowSizing() - totalRowspanCellHeight; 590 cell->logicalHeightForRowSizing() - totalRowspanCellHeight;
590 591
591 rowHeight = 592 rowHeight = std::max(
592 std::max(rowHeight, extraHeightRequired / 593 rowHeight,
593 spanningCellsRowsCountHavingZeroHeight); 594 extraHeightRequired / spanningCellsRowsCountHavingZeroHeight);
594 } 595 }
595 } 596 }
596 597
597 return rowHeight; 598 return rowHeight;
598 } 599 }
599 600
600 void LayoutTableSection::updateRowsHeightHavingOnlySpanningCells( 601 void LayoutTableSection::updateRowsHeightHavingOnlySpanningCells(
601 LayoutTableCell* cell, 602 LayoutTableCell* cell,
602 struct SpanningRowsHeight& spanningRowsHeight, 603 struct SpanningRowsHeight& spanningRowsHeight,
603 unsigned& extraHeightToPropagate, 604 unsigned& extraHeightToPropagate,
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 (cell->paddingBefore() - cell->intrinsicPaddingBefore())) { 805 (cell->paddingBefore() - cell->intrinsicPaddingBefore())) {
805 m_grid[row].baseline = std::max(m_grid[row].baseline, baselinePosition); 806 m_grid[row].baseline = std::max(m_grid[row].baseline, baselinePosition);
806 807
807 int cellStartRowBaselineDescent = 0; 808 int cellStartRowBaselineDescent = 0;
808 if (cell->rowSpan() == 1) { 809 if (cell->rowSpan() == 1) {
809 baselineDescent = 810 baselineDescent =
810 std::max(baselineDescent, 811 std::max(baselineDescent,
811 cell->logicalHeightForRowSizing() - baselinePosition); 812 cell->logicalHeightForRowSizing() - baselinePosition);
812 cellStartRowBaselineDescent = baselineDescent; 813 cellStartRowBaselineDescent = baselineDescent;
813 } 814 }
814 m_rowPos[row + 1] = 815 m_rowPos[row + 1] = std::max<int>(
815 std::max<int>(m_rowPos[row + 1], m_rowPos[row] + m_grid[row].baseline + 816 m_rowPos[row + 1],
816 cellStartRowBaselineDescent); 817 m_rowPos[row] + m_grid[row].baseline + cellStartRowBaselineDescent);
817 } 818 }
818 } 819 }
819 820
820 int LayoutTableSection::calcRowLogicalHeight() { 821 int LayoutTableSection::calcRowLogicalHeight() {
821 #if DCHECK_IS_ON() 822 #if DCHECK_IS_ON()
822 SetLayoutNeededForbiddenScope layoutForbiddenScope(*this); 823 SetLayoutNeededForbiddenScope layoutForbiddenScope(*this);
823 #endif 824 #endif
824 825
825 ASSERT(!needsLayout()); 826 ASSERT(!needsLayout());
826 827
(...skipping 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after
2075 // the header in all columns. 2076 // the header in all columns.
2076 // Note that this is in flow thread coordinates, not visual coordinates. The 2077 // Note that this is in flow thread coordinates, not visual coordinates. The
2077 // enclosing LayoutFlowThread will convert to visual coordinates. 2078 // enclosing LayoutFlowThread will convert to visual coordinates.
2078 if (table()->header() == this && isRepeatingHeaderGroup()) 2079 if (table()->header() == this && isRepeatingHeaderGroup())
2079 rect.setHeight(table()->logicalHeight()); 2080 rect.setHeight(table()->logicalHeight());
2080 return LayoutTableBoxComponent::mapToVisualRectInAncestorSpace(ancestor, rect, 2081 return LayoutTableBoxComponent::mapToVisualRectInAncestorSpace(ancestor, rect,
2081 flags); 2082 flags);
2082 } 2083 }
2083 2084
2084 } // namespace blink 2085 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTableCell.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutTextControl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698