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

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

Issue 1318713003: Make classes and structures in core/layout fast-allocated. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « Source/core/layout/LayoutTable.h ('k') | Source/core/layout/LayoutTestHelper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 reserv ed. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2009, 2013 Apple Inc. All rights reserv ed.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 25 matching lines...) Expand all
36 36
37 enum CollapsedBorderSide { 37 enum CollapsedBorderSide {
38 CBSBefore, 38 CBSBefore,
39 CBSAfter, 39 CBSAfter,
40 CBSStart, 40 CBSStart,
41 CBSEnd 41 CBSEnd
42 }; 42 };
43 43
44 // Helper class for paintObject. 44 // Helper class for paintObject.
45 class CellSpan { 45 class CellSpan {
46 STACK_ALLOCATED();
46 public: 47 public:
47 CellSpan(unsigned start, unsigned end) 48 CellSpan(unsigned start, unsigned end)
48 : m_start(start) 49 : m_start(start)
49 , m_end(end) 50 , m_end(end)
50 { 51 {
51 } 52 }
52 53
53 unsigned start() const { return m_start; } 54 unsigned start() const { return m_start; }
54 unsigned end() const { return m_end; } 55 unsigned end() const { return m_end; }
55 56
(...skipping 29 matching lines...) Expand all
85 86
86 int calcRowLogicalHeight(); 87 int calcRowLogicalHeight();
87 void layoutRows(); 88 void layoutRows();
88 void computeOverflowFromCells(); 89 void computeOverflowFromCells();
89 90
90 LayoutTable* table() const { return toLayoutTable(parent()); } 91 LayoutTable* table() const { return toLayoutTable(parent()); }
91 92
92 typedef Vector<LayoutTableCell*, 2> SpanningLayoutTableCells; 93 typedef Vector<LayoutTableCell*, 2> SpanningLayoutTableCells;
93 94
94 struct CellStruct { 95 struct CellStruct {
96 ALLOW_ONLY_INLINE_ALLOCATION();
95 public: 97 public:
96 Vector<LayoutTableCell*, 1> cells; 98 Vector<LayoutTableCell*, 1> cells;
97 bool inColSpan; // true for columns after the first in a colspan 99 bool inColSpan; // true for columns after the first in a colspan
98 100
99 CellStruct() 101 CellStruct()
100 : inColSpan(false) 102 : inColSpan(false)
101 { 103 {
102 } 104 }
103 105
104 LayoutTableCell* primaryCell() 106 LayoutTableCell* primaryCell()
105 { 107 {
106 return hasCells() ? cells[cells.size() - 1] : 0; 108 return hasCells() ? cells[cells.size() - 1] : 0;
107 } 109 }
108 110
109 const LayoutTableCell* primaryCell() const 111 const LayoutTableCell* primaryCell() const
110 { 112 {
111 return hasCells() ? cells[cells.size() - 1] : 0; 113 return hasCells() ? cells[cells.size() - 1] : 0;
112 } 114 }
113 115
114 bool hasCells() const { return cells.size() > 0; } 116 bool hasCells() const { return cells.size() > 0; }
115 }; 117 };
116 118
117 typedef Vector<CellStruct> Row; 119 typedef Vector<CellStruct> Row;
118 120
119 struct RowStruct { 121 struct RowStruct {
122 ALLOW_ONLY_INLINE_ALLOCATION();
120 public: 123 public:
121 RowStruct() 124 RowStruct()
122 : rowLayoutObject(nullptr) 125 : rowLayoutObject(nullptr)
123 , baseline(-1) 126 , baseline(-1)
124 { 127 {
125 } 128 }
126 129
127 Row row; 130 Row row;
128 LayoutTableRow* rowLayoutObject; 131 LayoutTableRow* rowLayoutObject;
129 LayoutUnit baseline; 132 LayoutUnit baseline;
130 Length logicalHeight; 133 Length logicalHeight;
131 }; 134 };
132 135
133 struct SpanningRowsHeight { 136 struct SpanningRowsHeight {
137 STACK_ALLOCATED();
134 WTF_MAKE_NONCOPYABLE(SpanningRowsHeight); 138 WTF_MAKE_NONCOPYABLE(SpanningRowsHeight);
135 139
136 public: 140 public:
137 SpanningRowsHeight() 141 SpanningRowsHeight()
138 : totalRowsHeight(0) 142 : totalRowsHeight(0)
139 , spanningCellHeightIgnoringBorderSpacing(0) 143 , spanningCellHeightIgnoringBorderSpacing(0)
140 , isAnyRowWithOnlySpanningCells(false) 144 , isAnyRowWithOnlySpanningCells(false)
141 { 145 {
142 } 146 }
143 147
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 // It is held at LayoutTableSection level to spare memory consumption by tab le cells. 319 // It is held at LayoutTableSection level to spare memory consumption by tab le cells.
316 using CellsCollapsedBordersMap = HashMap<pair<const LayoutTableCell*, int>, CollapsedBorderValue>; 320 using CellsCollapsedBordersMap = HashMap<pair<const LayoutTableCell*, int>, CollapsedBorderValue>;
317 CellsCollapsedBordersMap m_cellsCollapsedBorders; 321 CellsCollapsedBordersMap m_cellsCollapsedBorders;
318 }; 322 };
319 323
320 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTableSection, isTableSection()); 324 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTableSection, isTableSection());
321 325
322 } // namespace blink 326 } // namespace blink
323 327
324 #endif // LayoutTableSection_h 328 #endif // LayoutTableSection_h
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutTable.h ('k') | Source/core/layout/LayoutTestHelper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698