Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.h |
| diff --git a/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.h b/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.h |
| index 30b072578619e41450c4f3ee5d27c8fb7f875b8a..31c7ad3ce92a2220d6857dcc46ff7830cfc2d213 100644 |
| --- a/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.h |
| +++ b/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.h |
| @@ -44,7 +44,21 @@ class MultiColumnFragmentainerGroup { |
| LayoutUnit LogicalTop() const { return logical_top_; } |
| void SetLogicalTop(LayoutUnit logical_top) { logical_top_ = logical_top; } |
| - LayoutUnit LogicalHeight() const { return column_height_; } |
| + // Return the amount of block space that this fragmentainer group takes up in |
| + // its containing LayoutMultiColumnSet. |
| + LayoutUnit GroupLogicalHeight() const { return logical_height_; } |
| + |
| + // Return the block size of a column (or fragmentainer) in this fragmentainer |
| + // group. The spec says that this value must always be >= 1px, to ensure |
|
eae
2017/05/12 16:31:21
These comments are great! Thank you.
|
| + // progress. |
| + LayoutUnit ColumnLogicalHeight() const { |
| + // If the height hasn't been calculated yet, though, we allow returning 0 |
| + // (and the caller is then expected to refrain from attempting to fragment). |
| + if (!logical_height_) |
| + return logical_height_; |
| + |
| + return std::max(LayoutUnit(1), logical_height_); |
| + } |
| LayoutSize OffsetFromColumnSet() const; |
| @@ -156,7 +170,7 @@ class MultiColumnFragmentainerGroup { |
| LayoutRect ColumnRectAt(unsigned column_index) const; |
| LayoutUnit LogicalTopInFlowThreadAt(unsigned column_index) const { |
| - return logical_top_in_flow_thread_ + column_index * column_height_; |
| + return logical_top_in_flow_thread_ + column_index * ColumnLogicalHeight(); |
| } |
| // Return the column that the specified visual point belongs to. Only the |
| @@ -170,9 +184,13 @@ class MultiColumnFragmentainerGroup { |
| LayoutUnit logical_top_in_flow_thread_; |
| LayoutUnit logical_bottom_in_flow_thread_; |
| - LayoutUnit column_height_; |
| + // Logical height of the group. This will also be the height of each column |
| + // in this group, with the difference that, while the logical height can be |
| + // 0, the height of a column must be >= 1px. |
| + LayoutUnit logical_height_; |
| - LayoutUnit max_column_height_; // Maximum column height allowed. |
| + // Maximum logical height allowed. |
| + LayoutUnit max_logical_height_; |
| }; |
| // List of all fragmentainer groups within a column set. There will always be at |