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

Side by Side Diff: third_party/WebKit/Source/core/paint/TableSectionPainter.cpp

Issue 2534413004: Made varied number of cells in each row based on row's requirement. (Closed)
Patch Set: Fixed Layout test crash. 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/TableSectionPainter.h" 5 #include "core/paint/TableSectionPainter.h"
6 6
7 #include "core/layout/LayoutTableCell.h" 7 #include "core/layout/LayoutTableCell.h"
8 #include "core/layout/LayoutTableCol.h" 8 #include "core/layout/LayoutTableCol.h"
9 #include "core/layout/LayoutTableRow.h" 9 #include "core/layout/LayoutTableRow.h"
10 #include "core/paint/BoxClipper.h" 10 #include "core/paint/BoxClipper.h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 184
185 if (dirtiedColumns.start() >= dirtiedColumns.end()) 185 if (dirtiedColumns.start() >= dirtiedColumns.end())
186 return; 186 return;
187 187
188 // Collapsed borders are painted from the bottom right to the top left so that 188 // Collapsed borders are painted from the bottom right to the top left so that
189 // precedence due to cell position is respected. 189 // precedence due to cell position is respected.
190 for (unsigned r = dirtiedRows.end(); r > dirtiedRows.start(); r--) { 190 for (unsigned r = dirtiedRows.end(); r > dirtiedRows.start(); r--) {
191 unsigned row = r - 1; 191 unsigned row = r - 1;
192 for (unsigned c = dirtiedColumns.end(); c > dirtiedColumns.start(); c--) { 192 for (unsigned c = dirtiedColumns.end(); c > dirtiedColumns.start(); c--) {
193 unsigned col = c - 1; 193 unsigned col = c - 1;
194 const LayoutTableSection::CellStruct& current = 194 const LayoutTableCell* cell =
195 m_layoutTableSection.cellAt(row, col); 195 m_layoutTableSection.primaryCellAt(row, col);
196 const LayoutTableCell* cell = current.primaryCell();
197 if (!cell || (row > dirtiedRows.start() && 196 if (!cell || (row > dirtiedRows.start() &&
198 m_layoutTableSection.primaryCellAt(row - 1, col) == cell) || 197 m_layoutTableSection.primaryCellAt(row - 1, col) == cell) ||
199 (col > dirtiedColumns.start() && 198 (col > dirtiedColumns.start() &&
200 m_layoutTableSection.primaryCellAt(row, col - 1) == cell)) 199 m_layoutTableSection.primaryCellAt(row, col - 1) == cell))
201 continue; 200 continue;
202 LayoutPoint cellPoint = m_layoutTableSection.flipForWritingModeForChild( 201 LayoutPoint cellPoint = m_layoutTableSection.flipForWritingModeForChild(
203 cell, adjustedPaintOffset); 202 cell, adjustedPaintOffset);
204 TableCellPainter(*cell).paintCollapsedBorders(paintInfo, cellPoint, 203 TableCellPainter(*cell).paintCollapsedBorders(paintInfo, cellPoint,
205 currentBorderValue); 204 currentBorderValue);
206 } 205 }
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 for (unsigned r = dirtiedRows.start(); r < dirtiedRows.end(); r++) { 297 for (unsigned r = dirtiedRows.start(); r < dirtiedRows.end(); r++) {
299 const LayoutTableRow* row = m_layoutTableSection.rowLayoutObjectAt(r); 298 const LayoutTableRow* row = m_layoutTableSection.rowLayoutObjectAt(r);
300 // TODO(crbug.com/577282): This painting order is inconsistent with other 299 // TODO(crbug.com/577282): This painting order is inconsistent with other
301 // outlines. 300 // outlines.
302 if (row && !row->hasSelfPaintingLayer() && 301 if (row && !row->hasSelfPaintingLayer() &&
303 shouldPaintSelfOutline(paintInfoForDescendants.phase)) 302 shouldPaintSelfOutline(paintInfoForDescendants.phase))
304 TableRowPainter(*row).paintOutline(paintInfoForDescendants, 303 TableRowPainter(*row).paintOutline(paintInfoForDescendants,
305 paintOffset); 304 paintOffset);
306 for (unsigned c = dirtiedColumns.start(); c < dirtiedColumns.end(); c++) { 305 for (unsigned c = dirtiedColumns.start(); c < dirtiedColumns.end(); c++) {
307 const LayoutTableSection::CellStruct& current = 306 const LayoutTableSection::CellStruct& current =
308 m_layoutTableSection.cellAt(r, c); 307 m_layoutTableSection.cellAt(r, c);
mstensho (USE GERRIT) 2017/01/03 15:18:41 Aren't we forgetting to check that 'c' is within b
a.suchit 2017/01/04 10:35:18 Done.
309 for (LayoutTableCell* cell : current.cells) { 308 for (LayoutTableCell* cell : current.cells) {
310 if (overflowingCells.contains(cell)) 309 if (overflowingCells.contains(cell))
311 continue; 310 continue;
312 if (cell->rowSpan() > 1 || cell->colSpan() > 1) { 311 if (cell->rowSpan() > 1 || cell->colSpan() > 1) {
313 if (!spanningCells.add(cell).isNewEntry) 312 if (!spanningCells.add(cell).isNewEntry)
314 continue; 313 continue;
315 } 314 }
316 cells.append(cell); 315 cells.append(cell);
317 } 316 }
318 } 317 }
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 m_layoutTableSection.styleRef()); 403 m_layoutTableSection.styleRef());
405 } else { 404 } else {
406 // TODO(wangxianzhu): Calculate the inset shadow bounds by insetting 405 // TODO(wangxianzhu): Calculate the inset shadow bounds by insetting
407 // paintRect by half widths of collapsed borders. 406 // paintRect by half widths of collapsed borders.
408 BoxPainter::paintInsetBoxShadow(paintInfo, paintRect, 407 BoxPainter::paintInsetBoxShadow(paintInfo, paintRect,
409 m_layoutTableSection.styleRef()); 408 m_layoutTableSection.styleRef());
410 } 409 }
411 } 410 }
412 411
413 } // namespace blink 412 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698