Commit ab7fa607 authored by Christian Biesinger's avatar Christian Biesinger Committed by Commit Bot

[css-flexbox] More refactor: Store lines in the FlexibleBoxAlgorithm

R=eae@chromium.org

Change-Id: Ib267b515d4620ffa31de2ade2cdd4739c99027b9
Reviewed-on: https://chromium-review.googlesource.com/578391
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Commit-Queue: Emil A Eklund <eae@chromium.org>
Reviewed-by: default avatarEmil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488091}
parent bbd51398
...@@ -53,35 +53,40 @@ FlexLayoutAlgorithm::FlexLayoutAlgorithm(const ComputedStyle* style, ...@@ -53,35 +53,40 @@ FlexLayoutAlgorithm::FlexLayoutAlgorithm(const ComputedStyle* style,
const Vector<FlexItem>& all_items) const Vector<FlexItem>& all_items)
: style_(style), : style_(style),
line_break_length_(line_break_length), line_break_length_(line_break_length),
all_items_(all_items) {} all_items_(all_items),
next_item_index_(0) {}
bool FlexLayoutAlgorithm::ComputeNextFlexLine(size_t* next_index, FlexLine* FlexLayoutAlgorithm::ComputeNextFlexLine() {
FlexLine* line) { FlexLine new_line;
line->Reset();
bool line_has_in_flow_item = false; bool line_has_in_flow_item = false;
for (; *next_index < all_items_.size(); ++*next_index) { for (; next_item_index_ < all_items_.size(); ++next_item_index_) {
const FlexItem& flex_item = all_items_[*next_index]; const FlexItem& flex_item = all_items_[next_item_index_];
DCHECK(!flex_item.box->IsOutOfFlowPositioned()); DCHECK(!flex_item.box->IsOutOfFlowPositioned());
if (IsMultiline() && if (IsMultiline() &&
line->sum_hypothetical_main_size + new_line.sum_hypothetical_main_size +
flex_item.HypotheticalMainAxisMarginBoxSize() > flex_item.HypotheticalMainAxisMarginBoxSize() >
line_break_length_ && line_break_length_ &&
line_has_in_flow_item) line_has_in_flow_item)
break; break;
line->line_items.push_back(flex_item); new_line.line_items.push_back(flex_item);
line_has_in_flow_item = true; line_has_in_flow_item = true;
line->sum_flex_base_size += flex_item.FlexBaseMarginBoxSize(); new_line.sum_flex_base_size += flex_item.FlexBaseMarginBoxSize();
line->total_flex_grow += flex_item.box->Style()->FlexGrow(); new_line.total_flex_grow += flex_item.box->Style()->FlexGrow();
line->total_flex_shrink += flex_item.box->Style()->FlexShrink(); new_line.total_flex_shrink += flex_item.box->Style()->FlexShrink();
line->total_weighted_flex_shrink += new_line.total_weighted_flex_shrink +=
flex_item.box->Style()->FlexShrink() * flex_item.flex_base_content_size; flex_item.box->Style()->FlexShrink() * flex_item.flex_base_content_size;
line->sum_hypothetical_main_size += new_line.sum_hypothetical_main_size +=
flex_item.HypotheticalMainAxisMarginBoxSize(); flex_item.HypotheticalMainAxisMarginBoxSize();
} }
DCHECK(line->line_items.size() > 0 || *next_index == all_items_.size()); DCHECK(new_line.line_items.size() > 0 ||
return line->line_items.size() > 0; next_item_index_ == all_items_.size());
if (new_line.line_items.size() > 0) {
flex_lines_.push_back(std::move(new_line));
return &flex_lines_.back();
}
return nullptr;
} }
} // namespace blink } // namespace blink
...@@ -75,12 +75,8 @@ class FlexItem { ...@@ -75,12 +75,8 @@ class FlexItem {
}; };
struct FlexLine { struct FlexLine {
void Reset() { FlexLine() {
line_items.clear();
sum_flex_base_size = LayoutUnit();
total_flex_grow = total_flex_shrink = total_weighted_flex_shrink = 0; total_flex_grow = total_flex_shrink = total_weighted_flex_shrink = 0;
sum_hypothetical_main_size = LayoutUnit();
cross_axis_offset = cross_axis_extent = max_ascent = LayoutUnit();
} }
// These fields get filled in by ComputeNextFlexLine. // These fields get filled in by ComputeNextFlexLine.
...@@ -108,7 +104,11 @@ class FlexLayoutAlgorithm { ...@@ -108,7 +104,11 @@ class FlexLayoutAlgorithm {
LayoutUnit line_break_length, LayoutUnit line_break_length,
const Vector<FlexItem>& all_items); const Vector<FlexItem>& all_items);
bool ComputeNextFlexLine(size_t* next_index, FlexLine*); Vector<FlexLine>& FlexLines() { return flex_lines_; }
// Computes the next flex line, stores it in FlexLines(), and returns a
// pointer to it. Returns nullptr if there are no more lines.
FlexLine* ComputeNextFlexLine();
private: private:
bool IsMultiline() const { return style_->FlexWrap() != EFlexWrap::kNowrap; } bool IsMultiline() const { return style_->FlexWrap() != EFlexWrap::kNowrap; }
...@@ -116,6 +116,8 @@ class FlexLayoutAlgorithm { ...@@ -116,6 +116,8 @@ class FlexLayoutAlgorithm {
const ComputedStyle* style_; const ComputedStyle* style_;
LayoutUnit line_break_length_; LayoutUnit line_break_length_;
const Vector<FlexItem>& all_items_; const Vector<FlexItem>& all_items_;
Vector<FlexLine> flex_lines_;
size_t next_item_index_;
}; };
} // namespace blink } // namespace blink
......
...@@ -951,8 +951,6 @@ LayoutUnit LayoutFlexibleBox::ComputeInnerFlexBaseSizeForChild( ...@@ -951,8 +951,6 @@ LayoutUnit LayoutFlexibleBox::ComputeInnerFlexBaseSizeForChild(
void LayoutFlexibleBox::LayoutFlexItems(bool relayout_children, void LayoutFlexibleBox::LayoutFlexItems(bool relayout_children,
SubtreeLayoutScope& layout_scope) { SubtreeLayoutScope& layout_scope) {
Vector<FlexLine> line_contexts;
PaintLayerScrollableArea::PreventRelayoutScope prevent_relayout_scope( PaintLayerScrollableArea::PreventRelayoutScope prevent_relayout_scope(
layout_scope); layout_scope);
...@@ -978,20 +976,19 @@ void LayoutFlexibleBox::LayoutFlexItems(bool relayout_children, ...@@ -978,20 +976,19 @@ void LayoutFlexibleBox::LayoutFlexItems(bool relayout_children,
FlexLayoutAlgorithm flex_algorithm(Style(), line_break_length, all_items); FlexLayoutAlgorithm flex_algorithm(Style(), line_break_length, all_items);
LayoutUnit cross_axis_offset = LayoutUnit cross_axis_offset =
FlowAwareBorderBefore() + FlowAwarePaddingBefore(); FlowAwareBorderBefore() + FlowAwarePaddingBefore();
size_t next_index = 0; FlexLine* current_line;
FlexLine current_line; while ((current_line = flex_algorithm.ComputeNextFlexLine())) {
while (flex_algorithm.ComputeNextFlexLine(&next_index, &current_line)) { DCHECK_GE(current_line->line_items.size(), 0ULL);
DCHECK_GE(current_line.line_items.size(), 0ULL);
LayoutUnit container_main_inner_size = LayoutUnit container_main_inner_size =
MainAxisContentExtent(current_line.sum_hypothetical_main_size); MainAxisContentExtent(current_line->sum_hypothetical_main_size);
// availableFreeSpace is the initial amount of free space in this flexbox. // availableFreeSpace is the initial amount of free space in this flexbox.
// remainingFreeSpace starts out at the same value but as we place and lay // remainingFreeSpace starts out at the same value but as we place and lay
// out flex items we subtract from it. Note that both values can be // out flex items we subtract from it. Note that both values can be
// negative. // negative.
LayoutUnit remaining_free_space = LayoutUnit remaining_free_space =
container_main_inner_size - current_line.sum_flex_base_size; container_main_inner_size - current_line->sum_flex_base_size;
FlexSign flex_sign = FlexSign flex_sign =
(current_line.sum_hypothetical_main_size < container_main_inner_size) (current_line->sum_hypothetical_main_size < container_main_inner_size)
? kPositiveFlexibility ? kPositiveFlexibility
: kNegativeFlexibility; : kNegativeFlexibility;
FreezeInflexibleItems(flex_sign, current_line, remaining_free_space); FreezeInflexibleItems(flex_sign, current_line, remaining_free_space);
...@@ -1000,22 +997,21 @@ void LayoutFlexibleBox::LayoutFlexItems(bool relayout_children, ...@@ -1000,22 +997,21 @@ void LayoutFlexibleBox::LayoutFlexItems(bool relayout_children,
const LayoutUnit initial_free_space = remaining_free_space; const LayoutUnit initial_free_space = remaining_free_space;
while (!ResolveFlexibleLengths(flex_sign, current_line, initial_free_space, while (!ResolveFlexibleLengths(flex_sign, current_line, initial_free_space,
remaining_free_space)) { remaining_free_space)) {
DCHECK_GE(current_line.total_flex_grow, 0); DCHECK_GE(current_line->total_flex_grow, 0);
DCHECK_GE(current_line.total_weighted_flex_shrink, 0); DCHECK_GE(current_line->total_weighted_flex_shrink, 0);
} }
// Recalculate the remaining free space. The adjustment for flex factors // Recalculate the remaining free space. The adjustment for flex factors
// between 0..1 means we can't just use remainingFreeSpace here. // between 0..1 means we can't just use remainingFreeSpace here.
remaining_free_space = container_main_inner_size; remaining_free_space = container_main_inner_size;
for (size_t i = 0; i < current_line.line_items.size(); ++i) { for (size_t i = 0; i < current_line->line_items.size(); ++i) {
FlexItem& flex_item = current_line.line_items[i]; FlexItem& flex_item = current_line->line_items[i];
DCHECK(!flex_item.box->IsOutOfFlowPositioned()); DCHECK(!flex_item.box->IsOutOfFlowPositioned());
remaining_free_space -= flex_item.FlexedMarginBoxSize(); remaining_free_space -= flex_item.FlexedMarginBoxSize();
} }
LayoutAndPlaceChildren(cross_axis_offset, current_line, LayoutAndPlaceChildren(cross_axis_offset, current_line,
remaining_free_space, relayout_children, remaining_free_space, relayout_children,
layout_scope); layout_scope);
line_contexts.push_back(current_line);
} }
if (HasLineIfEmpty()) { if (HasLineIfEmpty()) {
// Even if ComputeNextFlexLine returns true, the flexbox might not have // Even if ComputeNextFlexLine returns true, the flexbox might not have
...@@ -1028,7 +1024,7 @@ void LayoutFlexibleBox::LayoutFlexItems(bool relayout_children, ...@@ -1028,7 +1024,7 @@ void LayoutFlexibleBox::LayoutFlexItems(bool relayout_children,
} }
UpdateLogicalHeight(); UpdateLogicalHeight();
RepositionLogicalHeightDependentFlexItems(line_contexts); RepositionLogicalHeightDependentFlexItems(flex_algorithm.FlexLines());
} }
LayoutUnit LayoutFlexibleBox::AutoMarginOffsetInMainAxis( LayoutUnit LayoutFlexibleBox::AutoMarginOffsetInMainAxis(
...@@ -1399,14 +1395,14 @@ void LayoutFlexibleBox::FreezeViolations(Vector<FlexItem*>& violations, ...@@ -1399,14 +1395,14 @@ void LayoutFlexibleBox::FreezeViolations(Vector<FlexItem*>& violations,
void LayoutFlexibleBox::FreezeInflexibleItems( void LayoutFlexibleBox::FreezeInflexibleItems(
FlexSign flex_sign, FlexSign flex_sign,
FlexLine& line, FlexLine* line,
LayoutUnit& remaining_free_space) { LayoutUnit& remaining_free_space) {
// Per https://drafts.csswg.org/css-flexbox/#resolve-flexible-lengths step 2, // Per https://drafts.csswg.org/css-flexbox/#resolve-flexible-lengths step 2,
// we freeze all items with a flex factor of 0 as well as those with a min/max // we freeze all items with a flex factor of 0 as well as those with a min/max
// size violation. // size violation.
Vector<FlexItem*> new_inflexible_items; Vector<FlexItem*> new_inflexible_items;
for (size_t i = 0; i < line.line_items.size(); ++i) { for (size_t i = 0; i < line->line_items.size(); ++i) {
FlexItem& flex_item = line.line_items[i]; FlexItem& flex_item = line->line_items[i];
LayoutBox* child = flex_item.box; LayoutBox* child = flex_item.box;
DCHECK(!flex_item.box->IsOutOfFlowPositioned()); DCHECK(!flex_item.box->IsOutOfFlowPositioned());
DCHECK(!flex_item.frozen) << i; DCHECK(!flex_item.frozen) << i;
...@@ -1425,14 +1421,14 @@ void LayoutFlexibleBox::FreezeInflexibleItems( ...@@ -1425,14 +1421,14 @@ void LayoutFlexibleBox::FreezeInflexibleItems(
} }
} }
FreezeViolations(new_inflexible_items, remaining_free_space, FreezeViolations(new_inflexible_items, remaining_free_space,
line.total_flex_grow, line.total_flex_shrink, line->total_flex_grow, line->total_flex_shrink,
line.total_weighted_flex_shrink); line->total_weighted_flex_shrink);
} }
// Returns true if we successfully ran the algorithm and sized the flex items. // Returns true if we successfully ran the algorithm and sized the flex items.
bool LayoutFlexibleBox::ResolveFlexibleLengths( bool LayoutFlexibleBox::ResolveFlexibleLengths(
FlexSign flex_sign, FlexSign flex_sign,
FlexLine& line, FlexLine* line,
LayoutUnit initial_free_space, LayoutUnit initial_free_space,
LayoutUnit& remaining_free_space) { LayoutUnit& remaining_free_space) {
LayoutUnit total_violation; LayoutUnit total_violation;
...@@ -1441,16 +1437,16 @@ bool LayoutFlexibleBox::ResolveFlexibleLengths( ...@@ -1441,16 +1437,16 @@ bool LayoutFlexibleBox::ResolveFlexibleLengths(
Vector<FlexItem*> max_violations; Vector<FlexItem*> max_violations;
double sum_flex_factors = (flex_sign == kPositiveFlexibility) double sum_flex_factors = (flex_sign == kPositiveFlexibility)
? line.total_flex_grow ? line->total_flex_grow
: line.total_flex_shrink; : line->total_flex_shrink;
if (sum_flex_factors > 0 && sum_flex_factors < 1) { if (sum_flex_factors > 0 && sum_flex_factors < 1) {
LayoutUnit fractional(initial_free_space * sum_flex_factors); LayoutUnit fractional(initial_free_space * sum_flex_factors);
if (fractional.Abs() < remaining_free_space.Abs()) if (fractional.Abs() < remaining_free_space.Abs())
remaining_free_space = fractional; remaining_free_space = fractional;
} }
for (size_t i = 0; i < line.line_items.size(); ++i) { for (size_t i = 0; i < line->line_items.size(); ++i) {
FlexItem& flex_item = line.line_items[i]; FlexItem& flex_item = line->line_items[i];
LayoutBox* child = flex_item.box; LayoutBox* child = flex_item.box;
// This check also covers out-of-flow children. // This check also covers out-of-flow children.
...@@ -1459,19 +1455,19 @@ bool LayoutFlexibleBox::ResolveFlexibleLengths( ...@@ -1459,19 +1455,19 @@ bool LayoutFlexibleBox::ResolveFlexibleLengths(
LayoutUnit child_size = flex_item.flex_base_content_size; LayoutUnit child_size = flex_item.flex_base_content_size;
double extra_space = 0; double extra_space = 0;
if (remaining_free_space > 0 && line.total_flex_grow > 0 && if (remaining_free_space > 0 && line->total_flex_grow > 0 &&
flex_sign == kPositiveFlexibility && flex_sign == kPositiveFlexibility &&
std::isfinite(line.total_flex_grow)) { std::isfinite(line->total_flex_grow)) {
extra_space = remaining_free_space * child->Style()->FlexGrow() / extra_space = remaining_free_space * child->Style()->FlexGrow() /
line.total_flex_grow; line->total_flex_grow;
} else if (remaining_free_space < 0 && } else if (remaining_free_space < 0 &&
line.total_weighted_flex_shrink > 0 && line->total_weighted_flex_shrink > 0 &&
flex_sign == kNegativeFlexibility && flex_sign == kNegativeFlexibility &&
std::isfinite(line.total_weighted_flex_shrink) && std::isfinite(line->total_weighted_flex_shrink) &&
child->Style()->FlexShrink()) { child->Style()->FlexShrink()) {
extra_space = remaining_free_space * child->Style()->FlexShrink() * extra_space = remaining_free_space * child->Style()->FlexShrink() *
flex_item.flex_base_content_size / flex_item.flex_base_content_size /
line.total_weighted_flex_shrink; line->total_weighted_flex_shrink;
} }
if (std::isfinite(extra_space)) if (std::isfinite(extra_space))
child_size += LayoutUnit::FromFloatRound(extra_space); child_size += LayoutUnit::FromFloatRound(extra_space);
...@@ -1492,8 +1488,8 @@ bool LayoutFlexibleBox::ResolveFlexibleLengths( ...@@ -1492,8 +1488,8 @@ bool LayoutFlexibleBox::ResolveFlexibleLengths(
if (total_violation) { if (total_violation) {
FreezeViolations(total_violation < 0 ? max_violations : min_violations, FreezeViolations(total_violation < 0 ? max_violations : min_violations,
remaining_free_space, line.total_flex_grow, remaining_free_space, line->total_flex_grow,
line.total_flex_shrink, line.total_weighted_flex_shrink); line->total_flex_shrink, line->total_weighted_flex_shrink);
} else { } else {
remaining_free_space -= used_free_space; remaining_free_space -= used_free_space;
} }
...@@ -1769,18 +1765,18 @@ EOverflow LayoutFlexibleBox::CrossAxisOverflowForChild( ...@@ -1769,18 +1765,18 @@ EOverflow LayoutFlexibleBox::CrossAxisOverflowForChild(
DISABLE_CFI_PERF DISABLE_CFI_PERF
void LayoutFlexibleBox::LayoutAndPlaceChildren( void LayoutFlexibleBox::LayoutAndPlaceChildren(
LayoutUnit& cross_axis_offset, LayoutUnit& cross_axis_offset,
FlexLine& current_line, FlexLine* current_line,
LayoutUnit available_free_space, LayoutUnit available_free_space,
bool relayout_children, bool relayout_children,
SubtreeLayoutScope& layout_scope) { SubtreeLayoutScope& layout_scope) {
const StyleContentAlignmentData justify_content = ResolvedJustifyContent(); const StyleContentAlignmentData justify_content = ResolvedJustifyContent();
LayoutUnit auto_margin_offset = LayoutUnit auto_margin_offset = AutoMarginOffsetInMainAxis(
AutoMarginOffsetInMainAxis(current_line.line_items, available_free_space); current_line->line_items, available_free_space);
LayoutUnit main_axis_offset = LayoutUnit main_axis_offset =
FlowAwareBorderStart() + FlowAwarePaddingStart(); FlowAwareBorderStart() + FlowAwarePaddingStart();
main_axis_offset += InitialContentPositionOffset( main_axis_offset += InitialContentPositionOffset(
available_free_space, justify_content, current_line.line_items.size()); available_free_space, justify_content, current_line->line_items.size());
if (Style()->FlexDirection() == EFlexDirection::kRowReverse && if (Style()->FlexDirection() == EFlexDirection::kRowReverse &&
ShouldPlaceBlockDirectionScrollbarOnLogicalLeft()) ShouldPlaceBlockDirectionScrollbarOnLogicalLeft())
main_axis_offset += IsHorizontalFlow() ? VerticalScrollbarWidth() main_axis_offset += IsHorizontalFlow() ? VerticalScrollbarWidth()
...@@ -1794,8 +1790,8 @@ void LayoutFlexibleBox::LayoutAndPlaceChildren( ...@@ -1794,8 +1790,8 @@ void LayoutFlexibleBox::LayoutAndPlaceChildren(
LayoutUnit max_child_cross_axis_extent; LayoutUnit max_child_cross_axis_extent;
bool should_flip_main_axis = !IsColumnFlow() && !IsLeftToRightFlow(); bool should_flip_main_axis = !IsColumnFlow() && !IsLeftToRightFlow();
bool is_paginated = View()->GetLayoutState()->IsPaginated(); bool is_paginated = View()->GetLayoutState()->IsPaginated();
for (size_t i = 0; i < current_line.line_items.size(); ++i) { for (size_t i = 0; i < current_line->line_items.size(); ++i) {
const FlexItem& flex_item = current_line.line_items[i]; const FlexItem& flex_item = current_line->line_items[i];
LayoutBox* child = flex_item.box; LayoutBox* child = flex_item.box;
DCHECK(!flex_item.box->IsOutOfFlowPositioned()); DCHECK(!flex_item.box->IsOutOfFlowPositioned());
...@@ -1844,12 +1840,12 @@ void LayoutFlexibleBox::LayoutAndPlaceChildren( ...@@ -1844,12 +1840,12 @@ void LayoutFlexibleBox::LayoutAndPlaceChildren(
CrossAxisExtentForChild(*child)) - CrossAxisExtentForChild(*child)) -
ascent; ascent;
current_line.max_ascent = std::max(current_line.max_ascent, ascent); current_line->max_ascent = std::max(current_line->max_ascent, ascent);
max_descent = std::max(max_descent, descent); max_descent = std::max(max_descent, descent);
// TODO(cbiesinger): Take scrollbar into account // TODO(cbiesinger): Take scrollbar into account
child_cross_axis_margin_box_extent = child_cross_axis_margin_box_extent =
current_line.max_ascent + max_descent; current_line->max_ascent + max_descent;
} else { } else {
child_cross_axis_margin_box_extent = child_cross_axis_margin_box_extent =
CrossAxisIntrinsicExtentForChild(*child) + CrossAxisIntrinsicExtentForChild(*child) +
...@@ -1876,11 +1872,11 @@ void LayoutFlexibleBox::LayoutAndPlaceChildren( ...@@ -1876,11 +1872,11 @@ void LayoutFlexibleBox::LayoutAndPlaceChildren(
SetFlowAwareLocationForChild(*child, child_location); SetFlowAwareLocationForChild(*child, child_location);
main_axis_offset += child_main_extent + FlowAwareMarginEndForChild(*child); main_axis_offset += child_main_extent + FlowAwareMarginEndForChild(*child);
if (i != current_line.line_items.size() - 1) { if (i != current_line->line_items.size() - 1) {
// The last item does not get extra space added. // The last item does not get extra space added.
main_axis_offset += ContentDistributionSpaceBetweenChildren( main_axis_offset += ContentDistributionSpaceBetweenChildren(
available_free_space, justify_content, available_free_space, justify_content,
current_line.line_items.size()); current_line->line_items.size());
} }
if (is_paginated) if (is_paginated)
...@@ -1897,14 +1893,14 @@ void LayoutFlexibleBox::LayoutAndPlaceChildren( ...@@ -1897,14 +1893,14 @@ void LayoutFlexibleBox::LayoutAndPlaceChildren(
// items since the start depends on the height of the flexbox, which we // items since the start depends on the height of the flexbox, which we
// only know after we've positioned all the flex items. // only know after we've positioned all the flex items.
UpdateLogicalHeight(); UpdateLogicalHeight();
LayoutColumnReverse(current_line.line_items, cross_axis_offset, LayoutColumnReverse(current_line->line_items, cross_axis_offset,
available_free_space); available_free_space);
} }
if (number_of_in_flow_children_on_first_line_ == -1) if (number_of_in_flow_children_on_first_line_ == -1)
number_of_in_flow_children_on_first_line_ = current_line.line_items.size(); number_of_in_flow_children_on_first_line_ = current_line->line_items.size();
current_line.cross_axis_offset = cross_axis_offset; current_line->cross_axis_offset = cross_axis_offset;
current_line.cross_axis_extent = max_child_cross_axis_extent; current_line->cross_axis_extent = max_child_cross_axis_extent;
cross_axis_offset += max_child_cross_axis_extent; cross_axis_offset += max_child_cross_axis_extent;
} }
......
...@@ -198,10 +198,10 @@ class CORE_EXPORT LayoutFlexibleBox : public LayoutBlock { ...@@ -198,10 +198,10 @@ class CORE_EXPORT LayoutFlexibleBox : public LayoutBlock {
FlexItem ConstructFlexItem(LayoutBox& child, ChildLayoutType); FlexItem ConstructFlexItem(LayoutBox& child, ChildLayoutType);
void FreezeInflexibleItems(FlexSign, void FreezeInflexibleItems(FlexSign,
FlexLine&, FlexLine*,
LayoutUnit& remaining_free_space); LayoutUnit& remaining_free_space);
bool ResolveFlexibleLengths(FlexSign, bool ResolveFlexibleLengths(FlexSign,
FlexLine&, FlexLine*,
LayoutUnit initial_free_space, LayoutUnit initial_free_space,
LayoutUnit& remaining_free_space); LayoutUnit& remaining_free_space);
void FreezeViolations(Vector<FlexItem*>&, void FreezeViolations(Vector<FlexItem*>&,
...@@ -215,7 +215,7 @@ class CORE_EXPORT LayoutFlexibleBox : public LayoutBlock { ...@@ -215,7 +215,7 @@ class CORE_EXPORT LayoutFlexibleBox : public LayoutBlock {
LayoutUnit child_preferred_size); LayoutUnit child_preferred_size);
void PrepareChildForPositionedLayout(LayoutBox& child); void PrepareChildForPositionedLayout(LayoutBox& child);
void LayoutAndPlaceChildren(LayoutUnit& cross_axis_offset, void LayoutAndPlaceChildren(LayoutUnit& cross_axis_offset,
FlexLine&, FlexLine*,
LayoutUnit available_free_space, LayoutUnit available_free_space,
bool relayout_children, bool relayout_children,
SubtreeLayoutScope&); SubtreeLayoutScope&);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment