#include "third_party/blink/renderer/core/editing/visible_units.h"
#include "third_party/blink/renderer/core/editing/editing_utilities.h"
#include "third_party/blink/renderer/core/editing/inline_box_position.h"
#include "third_party/blink/renderer/core/editing/ng_flat_tree_shorthands.h"
#include "third_party/blink/renderer/core/editing/text_offset_mapping.h"
#include "third_party/blink/renderer/core/editing/visible_position.h"
#include "third_party/blink/renderer/core/layout/inline/inline_caret_position.h"
#include "third_party/blink/renderer/core/layout/inline/line_utils.h"
#include "third_party/blink/renderer/core/layout/inline/offset_mapping.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
namespace blink {
namespace {
struct VisualOrdering;
static PositionWithAffinity AdjustForSoftLineWrap(
const InlineCursorPosition& line_box,
const PositionWithAffinity& position) { … }
template <typename Strategy, typename Ordering>
static PositionWithAffinityTemplate<Strategy> EndPositionForLine(
const PositionWithAffinityTemplate<Strategy>& c) { … }
template <typename Strategy, typename Ordering>
PositionWithAffinityTemplate<Strategy> StartPositionForLine(
const PositionWithAffinityTemplate<Strategy>& c) { … }
struct LogicalOrdering { … };
struct VisualOrdering { … };
template <typename Strategy>
PositionWithAffinityTemplate<Strategy> StartOfLineAlgorithm(
const PositionWithAffinityTemplate<Strategy>& c) { … }
bool IsInlineBlock(const LayoutBlockFlow* block_flow) { … }
}
PositionWithAffinity StartOfLine(const PositionWithAffinity& current_position) { … }
PositionInFlatTreeWithAffinity StartOfLine(
const PositionInFlatTreeWithAffinity& current_position) { … }
VisiblePosition StartOfLine(const VisiblePosition& current_position) { … }
VisiblePositionInFlatTree StartOfLine(
const VisiblePositionInFlatTree& current_position) { … }
template <typename Strategy>
static PositionWithAffinityTemplate<Strategy> LogicalStartOfLineAlgorithm(
const PositionWithAffinityTemplate<Strategy>& c) { … }
static PositionWithAffinity LogicalStartOfLine(
const PositionWithAffinity& position) { … }
static PositionInFlatTreeWithAffinity LogicalStartOfLine(
const PositionInFlatTreeWithAffinity& position) { … }
VisiblePosition LogicalStartOfLine(const VisiblePosition& current_position) { … }
VisiblePositionInFlatTree LogicalStartOfLine(
const VisiblePositionInFlatTree& current_position) { … }
template <typename Strategy>
static PositionWithAffinityTemplate<Strategy> EndOfLineAlgorithm(
const PositionWithAffinityTemplate<Strategy>& current_position) { … }
PositionWithAffinity EndOfLine(const PositionWithAffinity& position) { … }
PositionInFlatTreeWithAffinity EndOfLine(
const PositionInFlatTreeWithAffinity& position) { … }
template <typename Strategy>
static bool InSameLogicalLine(
const PositionWithAffinityTemplate<Strategy>& position1,
const PositionWithAffinityTemplate<Strategy>& position2) { … }
template <typename Strategy>
static PositionWithAffinityTemplate<Strategy> LogicalEndOfLineAlgorithm(
const PositionWithAffinityTemplate<Strategy>& current_position) { … }
static PositionWithAffinity LogicalEndOfLine(
const PositionWithAffinity& position) { … }
static PositionInFlatTreeWithAffinity LogicalEndOfLine(
const PositionInFlatTreeWithAffinity& position) { … }
VisiblePosition LogicalEndOfLine(const VisiblePosition& current_position) { … }
VisiblePositionInFlatTree LogicalEndOfLine(
const VisiblePositionInFlatTree& current_position) { … }
template <typename Strategy>
static bool InSameLineAlgorithm(
const PositionWithAffinityTemplate<Strategy>& position1,
const PositionWithAffinityTemplate<Strategy>& position2) { … }
bool InSameLine(const PositionWithAffinity& a, const PositionWithAffinity& b) { … }
bool InSameLine(const PositionInFlatTreeWithAffinity& position1,
const PositionInFlatTreeWithAffinity& position2) { … }
bool InSameLine(const VisiblePosition& position1,
const VisiblePosition& position2) { … }
bool InSameLine(const VisiblePositionInFlatTree& position1,
const VisiblePositionInFlatTree& position2) { … }
template <typename Strategy>
static bool IsStartOfLineAlgorithm(const VisiblePositionTemplate<Strategy>& p) { … }
bool IsStartOfLine(const VisiblePosition& p) { … }
bool IsStartOfLine(const VisiblePositionInFlatTree& p) { … }
template <typename Strategy>
static bool IsEndOfLineAlgorithm(
const VisiblePositionTemplate<Strategy>& visible_position) { … }
bool IsEndOfLine(const VisiblePosition& p) { … }
bool IsEndOfLine(const VisiblePositionInFlatTree& p) { … }
template <typename Strategy>
static bool IsLogicalEndOfLineAlgorithm(
const VisiblePositionTemplate<Strategy>& p) { … }
bool IsLogicalEndOfLine(const VisiblePosition& p) { … }
bool IsLogicalEndOfLine(const VisiblePositionInFlatTree& p) { … }
}