#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/core/layout/exclusions/exclusion_space.h"
#include <algorithm>
#include <optional>
#include "third_party/blink/renderer/core/layout/exclusions/exclusion_area.h"
#include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h"
namespace blink {
namespace {
void InsertClosedArea(
const ExclusionSpaceInternal::ClosedArea area,
HeapVector<ExclusionSpaceInternal::ClosedArea, 4>& areas) { … }
bool HasSolidEdges(const Vector<ExclusionSpaceInternal::ShelfEdge>& edges,
LayoutUnit block_start,
LayoutUnit block_end) { … }
void CollectSolidEdges(Vector<ExclusionSpaceInternal::ShelfEdge>* edges,
LayoutUnit block_offset,
Vector<ExclusionSpaceInternal::ShelfEdge>* out_edges) { … }
bool Intersects(const LayoutOpportunity& opportunity,
const BfcOffset& offset,
const LayoutUnit inline_size) { … }
LayoutOpportunity CreateLayoutOpportunity(const LayoutOpportunity& other,
const BfcOffset& offset,
const LayoutUnit inline_size) { … }
LayoutOpportunity CreateLayoutOpportunity(
const ExclusionSpaceInternal::Shelf& shelf,
const BfcOffset& offset,
const LayoutUnit inline_size) { … }
}
ExclusionSpaceInternal::ExclusionSpaceInternal()
: … { … }
ExclusionSpaceInternal::ExclusionSpaceInternal(
const ExclusionSpaceInternal& other)
: … { … }
ExclusionSpaceInternal& ExclusionSpaceInternal::operator=(
const ExclusionSpaceInternal& other) { … }
void ExclusionSpaceInternal::CopyFrom(const ExclusionSpaceInternal& other) { … }
void ExclusionSpace::CopyFrom(const ExclusionSpace& other) { … }
ExclusionSpaceInternal::DerivedGeometry::DerivedGeometry(
LayoutUnit block_offset_limit,
bool track_shape_exclusions)
: … { … }
void ExclusionSpaceInternal::Add(const ExclusionArea* exclusion) { … }
void ExclusionSpaceInternal::DerivedGeometry::Add(
const ExclusionArea& exclusion) { … }
LayoutOpportunity
ExclusionSpaceInternal::DerivedGeometry::FindLayoutOpportunity(
const BfcOffset& offset,
const LayoutUnit available_inline_size,
const LayoutUnit minimum_inline_size) const { … }
LayoutOpportunityVector
ExclusionSpaceInternal::DerivedGeometry::AllLayoutOpportunities(
const BfcOffset& offset,
const LayoutUnit available_inline_size) const { … }
template <typename LambdaFunc>
void ExclusionSpaceInternal::DerivedGeometry::IterateAllLayoutOpportunities(
const BfcOffset& offset,
const LayoutUnit available_inline_size,
const LambdaFunc& lambda) const { … }
const ExclusionSpaceInternal::DerivedGeometry&
ExclusionSpaceInternal::GetDerivedGeometry(
LayoutUnit block_offset_limit) const { … }
bool ExclusionSpaceInternal::operator==(
const ExclusionSpaceInternal& other) const { … }
}