Remove unused variable movedSectionLogicalTop from table layout code.
[chromium-blink-merge.git] / third_party / WebKit / Source / core / layout / TableLayoutAlgorithmAuto.h
blob32cd96af53ac88dc1f7a404a34243ee59367f726
1 /*
2 * Copyright (C) 2002 Lars Knoll (knoll@kde.org)
3 * (C) 2002 Dirk Mueller (mueller@kde.org)
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
21 #ifndef TableLayoutAlgorithmAuto_h
22 #define TableLayoutAlgorithmAuto_h
24 #include "core/layout/TableLayoutAlgorithm.h"
25 #include "platform/LayoutUnit.h"
26 #include "platform/Length.h"
27 #include "wtf/Vector.h"
29 namespace blink {
31 class LayoutTable;
32 class LayoutTableCell;
34 enum CellsToProcess {
35 AllCells,
36 NonEmptyCells,
37 EmptyCells
40 enum DistributionMode {
41 ExtraWidth,
42 InitialWidth,
43 LeftoverWidth
46 enum DistributionDirection {
47 StartToEnd,
48 EndToStart
51 class TableLayoutAlgorithmAuto final : public TableLayoutAlgorithm {
52 public:
53 TableLayoutAlgorithmAuto(LayoutTable*);
54 ~TableLayoutAlgorithmAuto() override;
56 void computeIntrinsicLogicalWidths(LayoutUnit& minWidth, LayoutUnit& maxWidth) override;
57 void applyPreferredLogicalWidthQuirks(LayoutUnit& minWidth, LayoutUnit& maxWidth) const override;
58 void layout() override;
59 void willChangeTableLayout() override { }
61 private:
62 void fullRecalc();
63 void recalcColumn(unsigned effCol);
65 int calcEffectiveLogicalWidth();
66 void shrinkColumnWidth(const LengthType&, int& available);
67 template<typename Total, LengthType, CellsToProcess, DistributionMode, DistributionDirection> void distributeWidthToColumns(int& available, Total);
69 void insertSpanCell(LayoutTableCell*);
71 struct Layout {
72 Layout()
73 : minLogicalWidth(0)
74 , maxLogicalWidth(0)
75 , effectiveMinLogicalWidth(0)
76 , effectiveMaxLogicalWidth(0)
77 , computedLogicalWidth(0)
78 , emptyCellsOnly(true)
79 , columnHasNoCells(true)
83 Length logicalWidth;
84 Length effectiveLogicalWidth;
85 int minLogicalWidth;
86 int maxLogicalWidth;
87 int effectiveMinLogicalWidth;
88 int effectiveMaxLogicalWidth;
89 int computedLogicalWidth;
90 bool emptyCellsOnly;
91 bool columnHasNoCells;
92 int clampedEffectiveMaxLogicalWidth() { return std::max<int>(1, effectiveMaxLogicalWidth); }
95 Vector<Layout, 4> m_layoutStruct;
96 Vector<LayoutTableCell*, 4> m_spanCells;
97 bool m_hasPercent : 1;
98 mutable bool m_effectiveLogicalWidthDirty : 1;
101 } // namespace blink
103 #endif // TableLayoutAlgorithmAuto