#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/core/editing/position_iterator.h"
#include "base/numerics/safe_conversions.h"
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/dom/text.h"
#include "third_party/blink/renderer/core/editing/editing_utilities.h"
#include "third_party/blink/renderer/core/editing/position.h"
namespace blink {
namespace {
template <typename Strategy>
bool ShouldTraverseChildren(const Node& node) { … }
template <typename Strategy>
int LastOffsetForPositionIterator(const Node* node) { … }
template <typename Strategy>
ContainerNode* SelectableParentOf(const Node& node) { … }
}
static constexpr int kInvalidOffset = …;
template <typename Strategy>
SlowPositionIteratorAlgorithm<Strategy>::SlowPositionIteratorAlgorithm(
const PositionTemplate<Strategy>& pos) { … }
template <typename Strategy>
PositionTemplate<Strategy>
SlowPositionIteratorAlgorithm<Strategy>::DeprecatedComputePosition() const { … }
template <typename Strategy>
PositionTemplate<Strategy>
SlowPositionIteratorAlgorithm<Strategy>::ComputePosition() const { … }
template <typename Strategy>
void SlowPositionIteratorAlgorithm<Strategy>::Increment() { … }
template <typename Strategy>
void SlowPositionIteratorAlgorithm<Strategy>::Decrement() { … }
template <typename Strategy>
bool SlowPositionIteratorAlgorithm<Strategy>::AtStart() const { … }
template <typename Strategy>
bool SlowPositionIteratorAlgorithm<Strategy>::AtEnd() const { … }
template <typename Strategy>
bool SlowPositionIteratorAlgorithm<Strategy>::AtStartOfNode() const { … }
template <typename Strategy>
bool SlowPositionIteratorAlgorithm<Strategy>::AtEndOfNode() const { … }
template class CORE_TEMPLATE_EXPORT
SlowPositionIteratorAlgorithm<EditingStrategy>;
template class CORE_TEMPLATE_EXPORT
SlowPositionIteratorAlgorithm<EditingInFlatTreeStrategy>;
template <typename Strategy>
typename FastPositionIteratorAlgorithm<Strategy>::ContainerType
FastPositionIteratorAlgorithm<Strategy>::ContainerToContainerType(
const Node* node) { … }
template <typename Strategy>
FastPositionIteratorAlgorithm<Strategy>::FastPositionIteratorAlgorithm(
const PositionType& position) { … }
template <typename Strategy>
void FastPositionIteratorAlgorithm<Strategy>::Initialize(
const PositionType& position) { … }
template <typename Strategy>
FastPositionIteratorAlgorithm<Strategy>::FastPositionIteratorAlgorithm() =
default;
template <typename Strategy>
void FastPositionIteratorAlgorithm<Strategy>::AssertOffsetInContainerIsValid()
const { … }
template <typename Strategy>
void FastPositionIteratorAlgorithm<Strategy>::AssertOffsetStackIsValid() const { … }
template <typename Strategy>
bool FastPositionIteratorAlgorithm<Strategy>::IsValid() const { … }
template <typename Strategy>
Node* FastPositionIteratorAlgorithm<Strategy>::ChildAfterPosition() const { … }
template <typename Strategy>
bool FastPositionIteratorAlgorithm<Strategy>::HasChildren() const { … }
template <typename Strategy>
bool FastPositionIteratorAlgorithm<Strategy>::IgnoresChildren() const { … }
template <typename Strategy>
bool FastPositionIteratorAlgorithm<Strategy>::IsUserSelectContain() const { … }
template <typename Strategy>
void FastPositionIteratorAlgorithm<Strategy>::Decrement() { … }
template <typename Strategy>
void FastPositionIteratorAlgorithm<Strategy>::Increment() { … }
template <typename Strategy>
void FastPositionIteratorAlgorithm<Strategy>::DecrementInternal() { … }
template <typename Strategy>
void FastPositionIteratorAlgorithm<Strategy>::IncrementInternal() { … }
template <typename Strategy>
void FastPositionIteratorAlgorithm<Strategy>::MoveToNextContainer() { … }
template <typename Strategy>
void FastPositionIteratorAlgorithm<Strategy>::MoveToNextSkippingChildren() { … }
template <typename Strategy>
void FastPositionIteratorAlgorithm<Strategy>::MoveToPreviousContainer() { … }
template <typename Strategy>
void FastPositionIteratorAlgorithm<Strategy>::MoveToPreviousSkippingChildren() { … }
template <typename Strategy>
void FastPositionIteratorAlgorithm<
Strategy>::SetChildBeforePositionToPreviosuSigblingOf(const Node& node) { … }
template <typename Strategy>
void FastPositionIteratorAlgorithm<Strategy>::SetContainer(Node* node) { … }
template <typename Strategy>
PositionTemplate<Strategy>
FastPositionIteratorAlgorithm<Strategy>::BeforeOrAfterPosition() const { … }
template <typename Strategy>
bool FastPositionIteratorAlgorithm<Strategy>::IsBeforePosition() const { … }
template <typename Strategy>
PositionTemplate<Strategy>
FastPositionIteratorAlgorithm<Strategy>::DeprecatedComputePosition() const { … }
template <typename Strategy>
PositionTemplate<Strategy>
FastPositionIteratorAlgorithm<Strategy>::ComputePosition() const { … }
template <typename Strategy>
int FastPositionIteratorAlgorithm<Strategy>::OffsetInTextNode() const { … }
template <typename Strategy>
bool FastPositionIteratorAlgorithm<Strategy>::AtStart() const { … }
template <typename Strategy>
bool FastPositionIteratorAlgorithm<Strategy>::AtEnd() const { … }
template <typename Strategy>
bool FastPositionIteratorAlgorithm<Strategy>::AtStartOfNode() const { … }
template <typename Strategy>
bool FastPositionIteratorAlgorithm<Strategy>::AtEndOfNode() const { … }
template <typename Strategy>
void FastPositionIteratorAlgorithm<Strategy>::EnsureOffsetInContainer() const { … }
template <typename Strategy>
void FastPositionIteratorAlgorithm<Strategy>::MoveOffsetInContainerBy(
int delta) { … }
template <typename Strategy>
void FastPositionIteratorAlgorithm<Strategy>::PopOffsetStack() { … }
template <typename Strategy>
void FastPositionIteratorAlgorithm<Strategy>::PushThenSetOffset(
unsigned offset_in_container) { … }
template class CORE_TEMPLATE_EXPORT
FastPositionIteratorAlgorithm<EditingStrategy>;
template class CORE_TEMPLATE_EXPORT
FastPositionIteratorAlgorithm<EditingInFlatTreeStrategy>;
template <typename Strategy>
PositionIteratorAlgorithm<Strategy>::PositionIteratorAlgorithm(
const PositionTemplate<Strategy>& position)
: … { … }
template <typename Strategy>
PositionIteratorAlgorithm<Strategy>::PositionIteratorAlgorithm(
const PositionIteratorAlgorithm& other)
: … { … }
template <typename Strategy>
PositionIteratorAlgorithm<Strategy>&
PositionIteratorAlgorithm<Strategy>::operator=(
const PositionIteratorAlgorithm& other) { … }
template <typename Strategy>
PositionTemplate<Strategy>
PositionIteratorAlgorithm<Strategy>::DeprecatedComputePosition() const { … }
template <typename Strategy>
PositionTemplate<Strategy>
PositionIteratorAlgorithm<Strategy>::ComputePosition() const { … }
template <typename Strategy>
void PositionIteratorAlgorithm<Strategy>::Decrement() { … }
template <typename Strategy>
void PositionIteratorAlgorithm<Strategy>::Increment() { … }
template <typename Strategy>
Node* PositionIteratorAlgorithm<Strategy>::GetNode() const { … }
template <typename Strategy>
int PositionIteratorAlgorithm<Strategy>::OffsetInTextNode() const { … }
template <typename Strategy>
bool PositionIteratorAlgorithm<Strategy>::AtStart() const { … }
template <typename Strategy>
bool PositionIteratorAlgorithm<Strategy>::AtEnd() const { … }
template <typename Strategy>
bool PositionIteratorAlgorithm<Strategy>::AtStartOfNode() const { … }
template <typename Strategy>
bool PositionIteratorAlgorithm<Strategy>::AtEndOfNode() const { … }
template class CORE_TEMPLATE_EXPORT PositionIteratorAlgorithm<EditingStrategy>;
template class CORE_TEMPLATE_EXPORT
PositionIteratorAlgorithm<EditingInFlatTreeStrategy>;
}