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

Unified Diff: Source/core/layout/TableLayoutAlgorithmAuto.h

Issue 1111443003: Refactor the code distributing width to columns in auto layout tables. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 5 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/layout/TableLayoutAlgorithmAuto.h
diff --git a/Source/core/layout/TableLayoutAlgorithmAuto.h b/Source/core/layout/TableLayoutAlgorithmAuto.h
index 079d80c34dc6294a93c8a319981dfaaa76e46de4..6692ffe73e3389fa9c74427cde9484d36ca8a849 100644
--- a/Source/core/layout/TableLayoutAlgorithmAuto.h
+++ b/Source/core/layout/TableLayoutAlgorithmAuto.h
@@ -31,6 +31,22 @@ namespace blink {
class LayoutTable;
class LayoutTableCell;
+enum CellsToProcess {
+ AllCells,
+ NonEmptyCells
+};
+
+enum DistributionMode {
+ ExtraWidth,
+ InitialWidth,
+ LeftoverWidth
+};
+
+enum DistributionDirection {
+ StartToEnd,
+ EndToStart
+};
+
class TableLayoutAlgorithmAuto final : public TableLayoutAlgorithm {
public:
TableLayoutAlgorithmAuto(LayoutTable*);
@@ -46,7 +62,8 @@ private:
void recalcColumn(unsigned effCol);
int calcEffectiveLogicalWidth();
- void shrinkCellWidth(const LengthType&, int& available);
+ void shrinkColumnWidth(const LengthType&, int& available);
+ template<typename Total, LengthType, CellsToProcess, DistributionMode, DistributionDirection> void distributeWidthToColumns(int& available, Total);
void insertSpanCell(LayoutTableCell*);

Powered by Google App Engine
This is Rietveld 408576698