#include "third_party/blink/renderer/core/layout/flex/flexible_box_algorithm.h"
#include "third_party/blink/renderer/core/frame/web_feature.h"
#include "third_party/blink/renderer/core/layout/flex/ng_flex_line.h"
#include "third_party/blink/renderer/core/layout/layout_box.h"
#include "third_party/blink/renderer/core/layout/logical_box_fragment.h"
#include "third_party/blink/renderer/core/layout/min_max_sizes.h"
#include "third_party/blink/renderer/platform/text/writing_mode.h"
namespace blink {
namespace {
ItemPosition BoxAlignmentToItemPosition(EBoxAlignment alignment) { … }
ContentPosition BoxPackToContentPosition(EBoxPack box_pack) { … }
ContentDistributionType BoxPackToContentDistribution(EBoxPack box_pack) { … }
}
FlexItem::FlexItem(const FlexibleBoxAlgorithm* algorithm,
const ComputedStyle& style,
LayoutUnit flex_base_content_size,
MinMaxSizes min_max_main_sizes,
LayoutUnit main_axis_border_padding,
PhysicalBoxStrut physical_margins,
BoxStrut scrollbars,
WritingMode baseline_writing_mode,
BaselineGroup baseline_group,
bool is_initial_block_size_indefinite,
bool is_used_flex_basis_indefinite,
bool depends_on_min_max_sizes)
: … { … }
bool FlexItem::MainAxisIsInlineAxis() const { … }
LayoutUnit FlexItem::FlowAwareMarginStart() const { … }
LayoutUnit FlexItem::FlowAwareMarginEnd() const { … }
LayoutUnit FlexItem::FlowAwareMarginBefore() const { … }
LayoutUnit FlexItem::FlowAwareMarginAfter() const { … }
LayoutUnit FlexItem::MarginBlockEnd() const { … }
LayoutUnit FlexItem::MainAxisMarginExtent() const { … }
LayoutUnit FlexItem::CrossAxisMarginExtent() const { … }
LayoutUnit FlexItem::MarginBoxAscent(bool is_last_baseline,
bool is_wrap_reverse) const { … }
ItemPosition FlexItem::Alignment() const { … }
void FlexItem::UpdateAutoMarginsInMainAxis(LayoutUnit auto_margin_offset) { … }
bool FlexItem::UpdateAutoMarginsInCrossAxis(
LayoutUnit available_alignment_space) { … }
LayoutUnit FlexItem::CrossAxisOffset(const NGFlexLine& line,
LayoutUnit cross_axis_size) { … }
void FlexItem::Trace(Visitor* visitor) const { … }
LayoutUnit FlexItem::AlignmentOffset(LayoutUnit available_free_space,
ItemPosition position,
LayoutUnit baseline_offset,
bool is_wrap_reverse,
bool is_deprecated_webkit_box) { … }
void FlexLine::FreezeViolations(ViolationsVector& violations) { … }
void FlexLine::FreezeInflexibleItems() { … }
bool FlexLine::ResolveFlexibleLengths() { … }
LayoutUnit FlexLine::ApplyMainAxisAutoMarginAdjustment() { … }
void FlexLine::ComputeLineItemsPosition(LayoutUnit main_axis_start_offset,
LayoutUnit main_axis_end_offset,
LayoutUnit& cross_axis_offset) { … }
LayoutUnit FlexibleBoxAlgorithm::GapBetweenItems(
const ComputedStyle& style,
LogicalSize percent_resolution_sizes) { … }
LayoutUnit FlexibleBoxAlgorithm::GapBetweenLines(
const ComputedStyle& style,
LogicalSize percent_resolution_sizes) { … }
FlexibleBoxAlgorithm::FlexibleBoxAlgorithm(const ComputedStyle* style,
LayoutUnit line_break_length,
LogicalSize percent_resolution_sizes,
Document* document)
: … { … }
FlexLine* FlexibleBoxAlgorithm::ComputeNextFlexLine(
LayoutUnit container_logical_width) { … }
bool FlexibleBoxAlgorithm::IsHorizontalFlow() const { … }
bool FlexibleBoxAlgorithm::IsColumnFlow() const { … }
bool FlexibleBoxAlgorithm::IsColumnFlow(const ComputedStyle& style) { … }
bool FlexibleBoxAlgorithm::IsHorizontalFlow(const ComputedStyle& style) { … }
const StyleContentAlignmentData&
FlexibleBoxAlgorithm::ContentAlignmentNormalBehavior() { … }
bool FlexibleBoxAlgorithm::ShouldApplyMinSizeAutoForChild(
const LayoutBox& child) const { … }
LayoutUnit FlexibleBoxAlgorithm::IntrinsicContentBlockSize() const { … }
void FlexibleBoxAlgorithm::AlignFlexLines(
LayoutUnit cross_axis_content_extent,
HeapVector<NGFlexLine>* flex_line_outputs) { … }
void FlexibleBoxAlgorithm::FlipForWrapReverse(
LayoutUnit cross_axis_start_edge,
LayoutUnit cross_axis_content_size,
HeapVector<NGFlexLine>* flex_line_outputs) { … }
PhysicalDirection FlexibleBoxAlgorithm::MainAxisDirection() const { … }
PhysicalDirection FlexibleBoxAlgorithm::CrossAxisDirection() const { … }
StyleContentAlignmentData FlexibleBoxAlgorithm::ResolvedJustifyContent(
const ComputedStyle& style) { … }
StyleContentAlignmentData FlexibleBoxAlgorithm::ResolvedAlignContent(
const ComputedStyle& style) { … }
ItemPosition FlexibleBoxAlgorithm::AlignmentForChild(
const ComputedStyle& flexbox_style,
const ComputedStyle& child_style) { … }
ItemPosition FlexibleBoxAlgorithm::TranslateItemPosition(
const ComputedStyle& flexbox_style,
const ComputedStyle& child_style,
ItemPosition align) { … }
LayoutUnit FlexibleBoxAlgorithm::InitialContentPositionOffset(
const ComputedStyle& style,
LayoutUnit available_free_space,
const StyleContentAlignmentData& data,
unsigned number_of_items,
bool is_reversed) { … }
LayoutUnit FlexibleBoxAlgorithm::ContentDistributionSpaceBetweenChildren(
LayoutUnit available_free_space,
const StyleContentAlignmentData& data,
unsigned number_of_items) { … }
void FlexibleBoxAlgorithm::LayoutColumnReverse(
LayoutUnit main_axis_content_size,
LayoutUnit border_scrollbar_padding_before) { … }
FlexItem* FlexibleBoxAlgorithm::FlexItemAtIndex(wtf_size_t line_index,
wtf_size_t item_index) const { … }
void FlexibleBoxAlgorithm::Trace(Visitor* visitor) const { … }
}