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

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

Issue 2884533002: Extract LayoutTableSection::CellStruct to a standalone class TableGridCell (Closed)
Patch Set: - Created 3 years, 7 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) 2002 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2002 Lars Knoll (knoll@kde.org)
3 * (C) 2002 Dirk Mueller (mueller@kde.org) 3 * (C) 2002 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2003, 2006, 2008, 2010 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2006, 2008, 2010 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License. 9 * version 2 of the License.
10 * 10 *
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 // we need to clear their dirty bits so that if we call 50 // we need to clear their dirty bits so that if we call
51 // setPreferredWidthsDirty(true) on a col or one of its descendants, we'll 51 // setPreferredWidthsDirty(true) on a col or one of its descendants, we'll
52 // mark it's ancestors as dirty. 52 // mark it's ancestors as dirty.
53 ToLayoutTableCol(child)->ClearPreferredLogicalWidthsDirtyBits(); 53 ToLayoutTableCol(child)->ClearPreferredLogicalWidthsDirtyBits();
54 } else if (child->IsTableSection()) { 54 } else if (child->IsTableSection()) {
55 LayoutTableSection* section = ToLayoutTableSection(child); 55 LayoutTableSection* section = ToLayoutTableSection(child);
56 unsigned num_rows = section->NumRows(); 56 unsigned num_rows = section->NumRows();
57 for (unsigned i = 0; i < num_rows; i++) { 57 for (unsigned i = 0; i < num_rows; i++) {
58 if (eff_col >= section->NumCols(i)) 58 if (eff_col >= section->NumCols(i))
59 continue; 59 continue;
60 LayoutTableSection::CellStruct current = section->CellAt(i, eff_col); 60 auto& grid_cell = section->GridCellAt(i, eff_col);
61 LayoutTableCell* cell = current.PrimaryCell(); 61 LayoutTableCell* cell = grid_cell.PrimaryCell();
62 62
63 if (current.in_col_span || !cell) 63 if (grid_cell.InColSpan() || !cell)
64 continue; 64 continue;
65 column_layout.column_has_no_cells = false; 65 column_layout.column_has_no_cells = false;
66 66
67 if (cell->MaxPreferredLogicalWidth()) 67 if (cell->MaxPreferredLogicalWidth())
68 column_layout.empty_cells_only = false; 68 column_layout.empty_cells_only = false;
69 69
70 if (cell->ColSpan() == 1) { 70 if (cell->ColSpan() == 1) {
71 column_layout.min_logical_width = 71 column_layout.min_logical_width =
72 std::max<int>(cell->MinPreferredLogicalWidth().ToInt(), 72 std::max<int>(cell->MinPreferredLogicalWidth().ToInt(),
73 column_layout.min_logical_width); 73 column_layout.min_logical_width);
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 int reduce = available * min_max_diff / logical_width_beyond_min; 873 int reduce = available * min_max_diff / logical_width_beyond_min;
874 layout_struct_[i].computed_logical_width += reduce; 874 layout_struct_[i].computed_logical_width += reduce;
875 available -= reduce; 875 available -= reduce;
876 logical_width_beyond_min -= min_max_diff; 876 logical_width_beyond_min -= min_max_diff;
877 if (available >= 0) 877 if (available >= 0)
878 break; 878 break;
879 } 879 }
880 } 880 }
881 } 881 }
882 } // namespace blink 882 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/TableGridCell.cpp ('k') | third_party/WebKit/Source/core/paint/TableSectionPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698