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

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

Issue 2534413004: Made varied number of cells in each row based on row's requirement. (Closed)
Patch Set: Reset TestExpectations file Created 3 years, 11 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, 2009, 2013 Apple Inc. All rights 7 * Copyright (C) 2003, 2004, 2005, 2006, 2009, 2013 Apple Inc. All rights
8 * reserved. 8 * reserved.
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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 const LayoutTableCell* firstRowCellAdjoiningTableStart() const; 211 const LayoutTableCell* firstRowCellAdjoiningTableStart() const;
212 const LayoutTableCell* firstRowCellAdjoiningTableEnd() const; 212 const LayoutTableCell* firstRowCellAdjoiningTableEnd() const;
213 213
214 CellStruct& cellAt(unsigned row, unsigned effectiveColumn) { 214 CellStruct& cellAt(unsigned row, unsigned effectiveColumn) {
215 return m_grid[row].row[effectiveColumn]; 215 return m_grid[row].row[effectiveColumn];
216 } 216 }
217 const CellStruct& cellAt(unsigned row, unsigned effectiveColumn) const { 217 const CellStruct& cellAt(unsigned row, unsigned effectiveColumn) const {
218 return m_grid[row].row[effectiveColumn]; 218 return m_grid[row].row[effectiveColumn];
219 } 219 }
220 LayoutTableCell* primaryCellAt(unsigned row, unsigned effectiveColumn) { 220 LayoutTableCell* primaryCellAt(unsigned row, unsigned effectiveColumn) {
221 if (effectiveColumn >= numCols(row))
222 return nullptr;
221 CellStruct& c = m_grid[row].row[effectiveColumn]; 223 CellStruct& c = m_grid[row].row[effectiveColumn];
222 return c.primaryCell(); 224 return c.primaryCell();
223 } 225 }
224 const LayoutTableCell* primaryCellAt(unsigned row, 226 const LayoutTableCell* primaryCellAt(unsigned row,
225 unsigned effectiveColumn) const { 227 unsigned effectiveColumn) const {
226 return const_cast<LayoutTableSection*>(this)->primaryCellAt( 228 return const_cast<LayoutTableSection*>(this)->primaryCellAt(
227 row, effectiveColumn); 229 row, effectiveColumn);
228 } 230 }
229 231
232 unsigned numCols(unsigned row) const { return m_grid[row].row.size(); }
233
230 // Returns null for cells with a rowspan that exceed the last row. Possibly 234 // Returns null for cells with a rowspan that exceed the last row. Possibly
231 // others. 235 // others.
232 LayoutTableRow* rowLayoutObjectAt(unsigned row) { 236 LayoutTableRow* rowLayoutObjectAt(unsigned row) {
233 return m_grid[row].rowLayoutObject; 237 return m_grid[row].rowLayoutObject;
234 } 238 }
235 const LayoutTableRow* rowLayoutObjectAt(unsigned row) const { 239 const LayoutTableRow* rowLayoutObjectAt(unsigned row) const {
236 return m_grid[row].rowLayoutObject; 240 return m_grid[row].rowLayoutObject;
237 } 241 }
238 242
239 void appendEffectiveColumn(unsigned pos); 243 void appendEffectiveColumn(unsigned pos);
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 } 342 }
339 343
340 void willBeRemovedFromTree() override; 344 void willBeRemovedFromTree() override;
341 345
342 void layout() override; 346 void layout() override;
343 347
344 int borderSpacingForRow(unsigned row) const { 348 int borderSpacingForRow(unsigned row) const {
345 return m_grid[row].rowLayoutObject ? table()->vBorderSpacing() : 0; 349 return m_grid[row].rowLayoutObject ? table()->vBorderSpacing() : 0;
346 } 350 }
347 351
348 void ensureRows(unsigned); 352 void ensureRows(unsigned numRows) {
353 if (numRows > m_grid.size())
354 m_grid.grow(numRows);
355 }
356
357 void ensureCols(unsigned rowIndex, unsigned numCols) {
358 if (numCols > this->numCols(rowIndex))
359 m_grid[rowIndex].row.grow(numCols);
360 }
349 361
350 bool rowHasOnlySpanningCells(unsigned); 362 bool rowHasOnlySpanningCells(unsigned);
351 unsigned calcRowHeightHavingOnlySpanningCells(unsigned, 363 unsigned calcRowHeightHavingOnlySpanningCells(unsigned,
352 int&, 364 int&,
353 unsigned, 365 unsigned,
354 unsigned&, 366 unsigned&,
355 Vector<int>&); 367 Vector<int>&);
356 void updateRowsHeightHavingOnlySpanningCells(LayoutTableCell*, 368 void updateRowsHeightHavingOnlySpanningCells(LayoutTableCell*,
357 struct SpanningRowsHeight&, 369 struct SpanningRowsHeight&,
358 unsigned&, 370 unsigned&,
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 // The use is to disable a painting optimization where we just paint the 475 // The use is to disable a painting optimization where we just paint the
464 // invalidated cells. 476 // invalidated cells.
465 bool m_hasMultipleCellLevels; 477 bool m_hasMultipleCellLevels;
466 }; 478 };
467 479
468 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTableSection, isTableSection()); 480 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTableSection, isTableSection());
469 481
470 } // namespace blink 482 } // namespace blink
471 483
472 #endif // LayoutTableSection_h 484 #endif // LayoutTableSection_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTable.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutTableSection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698