#include "third_party/blink/renderer/core/editing/position.h"
#include <stdio.h>
#include <ostream>
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/editing/editing_utilities.h"
#include "third_party/blink/renderer/core/editing/text_affinity.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
namespace blink {
#if DCHECK_IS_ON()
template <typename Strategy>
static bool CanBeAnchorNode(Node*);
template <>
bool CanBeAnchorNode<EditingStrategy>(Node* node) { … }
template <>
bool CanBeAnchorNode<EditingInFlatTreeStrategy>(Node* node) { … }
#endif
template <typename Strategy>
void PositionTemplate<Strategy>::Trace(Visitor* visitor) const { … }
template <typename Strategy>
const TreeScope* PositionTemplate<Strategy>::CommonAncestorTreeScope(
const PositionTemplate<Strategy>& a,
const PositionTemplate<Strategy>& b) { … }
template <typename Strategy>
PositionTemplate<Strategy> PositionTemplate<Strategy>::EditingPositionOf(
const Node* anchor_node,
int offset) { … }
template <typename Strategy>
PositionTemplate<Strategy>::PositionTemplate(const Node* anchor_node,
PositionAnchorType anchor_type)
: … { … }
template <typename Strategy>
PositionTemplate<Strategy>::PositionTemplate(const Node* anchor_node,
int offset)
: … { … }
template <typename Strategy>
PositionTemplate<Strategy>::PositionTemplate(const Node& anchor_node,
int offset)
: … { … }
template <typename Strategy>
PositionTemplate<Strategy>::PositionTemplate() = default;
template <typename Strategy>
PositionTemplate<Strategy>::PositionTemplate(const PositionTemplate&) = default;
template <typename Strategy>
PositionTemplate<Strategy>& PositionTemplate<Strategy>::operator=(
const PositionTemplate&) = default;
template <typename Strategy>
PositionTemplate<Strategy> PositionTemplate<Strategy>::CreateWithoutValidation(
const Node& container,
int offset) { … }
template <typename Strategy>
PositionTemplate<Strategy>
PositionTemplate<Strategy>::CreateWithoutValidationDeprecated(
const Node& container,
int offset) { … }
template <typename Strategy>
Node* PositionTemplate<Strategy>::ComputeContainerNode() const { … }
template <typename Strategy>
static int MinOffsetForNode(Node* anchor_node, int offset) { … }
template <typename Strategy>
int PositionTemplate<Strategy>::ComputeOffsetInContainerNode() const { … }
template <typename Strategy>
PositionTemplate<Strategy>
PositionTemplate<Strategy>::ParentAnchoredEquivalent() const { … }
template <typename Strategy>
PositionTemplate<Strategy> PositionTemplate<Strategy>::ToOffsetInAnchor()
const { … }
template <typename Strategy>
int PositionTemplate<Strategy>::ComputeEditingOffset() const { … }
template <typename Strategy>
Node* PositionTemplate<Strategy>::ComputeNodeBeforePosition() const { … }
template <typename Strategy>
Node* PositionTemplate<Strategy>::ComputeNodeAfterPosition() const { … }
template <typename Strategy>
Node* PositionTemplate<Strategy>::NodeAsRangeFirstNode() const { … }
template <typename Strategy>
Node* PositionTemplate<Strategy>::NodeAsRangeLastNode() const { … }
template <typename Strategy>
Node* PositionTemplate<Strategy>::NodeAsRangePastLastNode() const { … }
template <typename Strategy>
Node* PositionTemplate<Strategy>::CommonAncestorContainer(
const PositionTemplate<Strategy>& other) const { … }
static bool IsPositionConnected(const Position& position) { … }
static bool IsPositionConnected(const PositionInFlatTree& position) { … }
template <typename Strategy>
bool PositionTemplate<Strategy>::IsBeforeChildren() const { … }
template <typename Strategy>
bool PositionTemplate<Strategy>::IsConnected() const { … }
template <typename Strategy>
bool PositionTemplate<Strategy>::IsValidFor(const Document& document) const { … }
template <typename Strategy>
int16_t PositionTemplate<Strategy>::CompareTo(
const PositionTemplate<Strategy>& other) const { … }
template <typename Strategy>
bool PositionTemplate<Strategy>::operator<(
const PositionTemplate<Strategy>& other) const { … }
template <typename Strategy>
bool PositionTemplate<Strategy>::operator<=(
const PositionTemplate<Strategy>& other) const { … }
template <typename Strategy>
bool PositionTemplate<Strategy>::operator>(
const PositionTemplate<Strategy>& other) const { … }
template <typename Strategy>
bool PositionTemplate<Strategy>::operator>=(
const PositionTemplate<Strategy>& other) const { … }
template <typename Strategy>
bool PositionTemplate<Strategy>::IsEquivalent(
const PositionTemplate<Strategy>& other) const { … }
template <typename Strategy>
bool PositionTemplate<Strategy>::AtFirstEditingPositionForNode() const { … }
template <typename Strategy>
bool PositionTemplate<Strategy>::AtLastEditingPositionForNode() const { … }
template <typename Strategy>
bool PositionTemplate<Strategy>::AtStartOfTree() const { … }
template <typename Strategy>
PositionTemplate<Strategy> PositionTemplate<Strategy>::InParentBeforeNode(
const Node& node) { … }
template <typename Strategy>
PositionTemplate<Strategy> PositionTemplate<Strategy>::InParentAfterNode(
const Node& node) { … }
template <typename Strategy>
PositionTemplate<Strategy> PositionTemplate<Strategy>::BeforeNode(
const Node& anchor_node) { … }
template <typename Strategy>
PositionTemplate<Strategy> PositionTemplate<Strategy>::AfterNode(
const Node& anchor_node) { … }
template <typename Strategy>
int PositionTemplate<Strategy>::LastOffsetInNode(const Node& node) { … }
template <typename Strategy>
PositionTemplate<Strategy> PositionTemplate<Strategy>::FirstPositionInNode(
const Node& anchor_node) { … }
template <typename Strategy>
PositionTemplate<Strategy> PositionTemplate<Strategy>::LastPositionInNode(
const Node& anchor_node) { … }
template <typename Strategy>
PositionTemplate<Strategy>
PositionTemplate<Strategy>::FirstPositionInOrBeforeNode(const Node& node) { … }
template <typename Strategy>
PositionTemplate<Strategy>
PositionTemplate<Strategy>::LastPositionInOrAfterNode(const Node& node) { … }
PositionInFlatTree ToPositionInFlatTree(const Position& pos) { … }
PositionInFlatTree ToPositionInFlatTree(const PositionInFlatTree& position) { … }
Position ToPositionInDOMTree(const Position& position) { … }
Position ToPositionInDOMTree(const PositionInFlatTree& position) { … }
template <typename Strategy>
String PositionTemplate<Strategy>::ToAnchorTypeAndOffsetString() const { … }
#if DCHECK_IS_ON()
template <typename Strategy>
void PositionTemplate<Strategy>::ShowTreeForThis() const { … }
template <typename Strategy>
void PositionTemplate<Strategy>::ShowTreeForThisInFlatTree() const { … }
#endif
template <typename PositionType>
static std::ostream& PrintPosition(std::ostream& ostream,
const PositionType& position) { … }
std::ostream& operator<<(std::ostream& ostream,
PositionAnchorType anchor_type) { … }
std::ostream& operator<<(std::ostream& ostream, const Position& position) { … }
std::ostream& operator<<(std::ostream& ostream,
const PositionInFlatTree& position) { … }
template class CORE_TEMPLATE_EXPORT PositionTemplate<EditingStrategy>;
template class CORE_TEMPLATE_EXPORT PositionTemplate<EditingInFlatTreeStrategy>;
}
#if DCHECK_IS_ON()
void ShowTree(const blink::Position& pos) { … }
void ShowTree(const blink::Position* pos) { … }
#endif