#include "third_party/blink/renderer/core/editing/text_offset_mapping.h"
#include <ostream>
#include "third_party/blink/renderer/core/dom/node.h"
#include "third_party/blink/renderer/core/editing/editing_utilities.h"
#include "third_party/blink/renderer/core/editing/iterators/character_iterator.h"
#include "third_party/blink/renderer/core/editing/iterators/text_iterator.h"
#include "third_party/blink/renderer/core/editing/position.h"
#include "third_party/blink/renderer/core/html/forms/text_control_element.h"
#include "third_party/blink/renderer/core/layout/layout_block_flow.h"
namespace blink {
namespace {
bool HasNonPsuedoNode(const LayoutObject& parent) { … }
bool CanBeInlineContentsContainer(const LayoutObject& layout_object) { … }
Node* PreviousNodeSkippingAncestors(const Node& node) { … }
const LayoutBlockFlow& RootInlineContentsContainerOf(
const LayoutBlockFlow& block_flow) { … }
bool ShouldSkipChildren(const Node& node) { … }
LayoutObject* NextForInlineContents(const LayoutObject& layout_object,
const LayoutObject& container) { … }
const Node* FindFirstNonPseudoNodeIn(const LayoutObject& container) { … }
const Node* FindLastNonPseudoNodeIn(const LayoutObject& container) { … }
const LayoutBlockFlow* ComputeInlineContentsAsBlockFlow(
const LayoutObject& layout_object) { … }
TextOffsetMapping::InlineContents CreateInlineContentsFromBlockFlow(
const LayoutBlockFlow& block_flow,
const LayoutObject& target) { … }
TextOffsetMapping::InlineContents ComputeInlineContentsFromNode(
const Node& node) { … }
String Ensure16Bit(const String& text) { … }
}
TextOffsetMapping::TextOffsetMapping(const InlineContents& inline_contents,
const TextIteratorBehavior& behavior)
: … { … }
TextOffsetMapping::TextOffsetMapping(const InlineContents& inline_contents)
: … { … }
int TextOffsetMapping::ComputeTextOffset(
const PositionInFlatTree& position) const { … }
PositionInFlatTree TextOffsetMapping::GetPositionBefore(unsigned offset) const { … }
PositionInFlatTree TextOffsetMapping::GetPositionAfter(unsigned offset) const { … }
EphemeralRangeInFlatTree TextOffsetMapping::ComputeRange(unsigned start,
unsigned end) const { … }
unsigned TextOffsetMapping::FindNonWhitespaceCharacterFrom(
unsigned offset) const { … }
TextOffsetMapping::BackwardRange TextOffsetMapping::BackwardRangeOf(
const PositionInFlatTree& position) { … }
TextOffsetMapping::ForwardRange TextOffsetMapping::ForwardRangeOf(
const PositionInFlatTree& position) { … }
template <typename Traverser>
TextOffsetMapping::InlineContents TextOffsetMapping::FindInlineContentsInternal(
const Node* start_node,
Traverser traverser) { … }
TextOffsetMapping::InlineContents TextOffsetMapping::FindBackwardInlineContents(
const PositionInFlatTree& position) { … }
TextOffsetMapping::InlineContents TextOffsetMapping::FindForwardInlineContents(
const PositionInFlatTree& position) { … }
TextOffsetMapping::InlineContents::InlineContents(
const LayoutBlockFlow& block_flow)
: … { … }
TextOffsetMapping::InlineContents::InlineContents(
const LayoutBlockFlow& block_flow,
const LayoutObject* block_in_inline_before,
const LayoutObject& first,
const LayoutObject& last,
const LayoutObject* block_in_inline_after)
: … { … }
bool TextOffsetMapping::InlineContents::operator==(
const InlineContents& other) const { … }
const LayoutBlockFlow* TextOffsetMapping::InlineContents::GetEmptyBlock()
const { … }
const LayoutObject& TextOffsetMapping::InlineContents::FirstLayoutObject()
const { … }
const LayoutObject& TextOffsetMapping::InlineContents::LastLayoutObject()
const { … }
EphemeralRangeInFlatTree TextOffsetMapping::InlineContents::GetRange() const { … }
PositionInFlatTree
TextOffsetMapping::InlineContents::LastPositionBeforeBlockFlow() const { … }
PositionInFlatTree
TextOffsetMapping::InlineContents::FirstPositionAfterBlockFlow() const { … }
TextOffsetMapping::InlineContents TextOffsetMapping::InlineContents::NextOf(
const InlineContents& inline_contents) { … }
TextOffsetMapping::InlineContents TextOffsetMapping::InlineContents::PreviousOf(
const InlineContents& inline_contents) { … }
std::ostream& operator<<(
std::ostream& ostream,
const TextOffsetMapping::InlineContents& inline_contents) { … }
TextOffsetMapping::InlineContents TextOffsetMapping::BackwardRange::Iterator::
operator*() const { … }
void TextOffsetMapping::BackwardRange::Iterator::operator++() { … }
TextOffsetMapping::InlineContents TextOffsetMapping::ForwardRange::Iterator::
operator*() const { … }
void TextOffsetMapping::ForwardRange::Iterator::operator++() { … }
}