#include "third_party/blink/renderer/core/layout/inline/line_truncator.h"
#include "base/containers/adapters.h"
#include "third_party/blink/renderer/core/layout/inline/inline_box_state.h"
#include "third_party/blink/renderer/core/layout/inline/inline_item_result.h"
#include "third_party/blink/renderer/core/layout/inline/line_info.h"
#include "third_party/blink/renderer/core/layout/inline/logical_line_item.h"
#include "third_party/blink/renderer/core/layout/physical_box_fragment.h"
#include "third_party/blink/renderer/platform/fonts/font_baseline.h"
#include "third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.h"
#include "third_party/blink/renderer/platform/fonts/shaping/shape_result_view.h"
namespace blink {
namespace {
bool IsLeftMostOffset(const ShapeResult& shape_result, unsigned offset) { … }
bool IsRightMostOffset(const ShapeResult& shape_result, unsigned offset) { … }
}
LineTruncator::LineTruncator(const LineInfo& line_info)
: … { … }
const ComputedStyle& LineTruncator::EllipsisStyle() const { … }
void LineTruncator::SetupEllipsis() { … }
LayoutUnit LineTruncator::PlaceEllipsisNextTo(
LogicalLineItems* line_box,
LogicalLineItem* ellipsized_child) { … }
wtf_size_t LineTruncator::AddTruncatedChild(
wtf_size_t source_index,
bool leave_one_character,
LayoutUnit position,
TextDirection edge,
LogicalLineItems* line_box,
InlineLayoutStateStack* box_states) { … }
LayoutUnit LineTruncator::TruncateLine(LayoutUnit line_width,
LogicalLineItems* line_box,
InlineLayoutStateStack* box_states) { … }
LayoutUnit LineTruncator::TruncateLineInTheMiddle(
LayoutUnit line_width,
LogicalLineItems* line_box,
InlineLayoutStateStack* box_states) { … }
void LineTruncator::HideChild(LogicalLineItem* child) { … }
bool LineTruncator::EllipsizeChild(
LayoutUnit line_width,
LayoutUnit ellipsis_width,
bool is_first_child,
LogicalLineItem* child,
std::optional<LogicalLineItem>* truncated_child) { … }
bool LineTruncator::TruncateChild(
LayoutUnit space_for_child,
bool is_first_child,
const LogicalLineItem& child,
std::optional<LogicalLineItem>* truncated_child) { … }
LogicalLineItem LineTruncator::TruncateText(const LogicalLineItem& item,
const ShapeResult& shape_result,
unsigned offset_to_fit,
TextDirection direction) { … }
}