#include "third_party/blink/renderer/core/layout/inline/inline_caret_position.h"
#include "third_party/blink/renderer/core/editing/bidi_adjustment.h"
#include "third_party/blink/renderer/core/editing/position_with_affinity.h"
#include "third_party/blink/renderer/core/editing/text_affinity.h"
#include "third_party/blink/renderer/core/layout/inline/fragment_item.h"
#include "third_party/blink/renderer/core/layout/inline/inline_cursor.h"
#include "third_party/blink/renderer/core/layout/inline/inline_node.h"
#include "third_party/blink/renderer/core/layout/inline/offset_mapping.h"
#include "third_party/blink/renderer/core/layout/inline/physical_line_box_fragment.h"
#include "third_party/blink/renderer/core/layout/layout_block_flow.h"
namespace blink {
namespace {
enum class ResolutionType { … };
struct InlineCaretPositionResolution { … };
bool CanResolveInlineCaretPositionBeforeFragment(const InlineCursor& cursor,
TextAffinity affinity) { … }
bool CanResolveInlineCaretPositionAfterFragment(const InlineCursor& cursor,
TextAffinity affinity) { … }
InlineCaretPositionResolution TryResolveInlineCaretPositionInTextFragment(
const InlineCursor& cursor,
unsigned offset,
TextAffinity affinity) { … }
unsigned GetTextOffsetBefore(const Node& node) { … }
InlineCaretPositionResolution TryResolveInlineCaretPositionByBoxFragmentSide(
const InlineCursor& cursor,
unsigned offset,
TextAffinity affinity) { … }
InlineCaretPositionResolution TryResolveInlineCaretPositionWithFragment(
const InlineCursor& cursor,
unsigned offset,
TextAffinity affinity) { … }
bool NeedsBidiAdjustment(const InlineCaretPosition& caret_position) { … }
InlineCaretPosition AdjustInlineCaretPositionForBidiText(
const InlineCaretPosition& caret_position) { … }
bool IsUpstreamAfterLineBreak(const InlineCaretPosition& caret_position) { … }
InlineCaretPosition BetterCandidateBetween(const InlineCaretPosition& current,
const InlineCaretPosition& other,
unsigned offset) { … }
InlineCaretPosition ComputeInlineCaretPositionAfterInline(
const PositionWithAffinity& position_with_affinity) { … }
InlineCaretPosition ComputeInlineCaretPositionBeforeInline(
const PositionWithAffinity& position_with_affinity) { … }
}
InlineCaretPosition ComputeInlineCaretPosition(const LayoutBlockFlow& context,
unsigned offset,
TextAffinity affinity,
const LayoutText* layout_text) { … }
InlineCaretPosition ComputeInlineCaretPosition(
const PositionWithAffinity& position_with_affinity) { … }
Position InlineCaretPosition::ToPositionInDOMTree() const { … }
PositionWithAffinity InlineCaretPosition::ToPositionInDOMTreeWithAffinity()
const { … }
}