#include "third_party/blink/renderer/core/editing/visible_selection.h"
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/dom/range.h"
#include "third_party/blink/renderer/core/editing/editing_utilities.h"
#include "third_party/blink/renderer/core/editing/ephemeral_range.h"
#include "third_party/blink/renderer/core/editing/iterators/character_iterator.h"
#include "third_party/blink/renderer/core/editing/selection_adjuster.h"
#include "third_party/blink/renderer/core/editing/selection_template.h"
#include "third_party/blink/renderer/core/editing/visible_position.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/wtf/text/character_names.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
namespace blink {
template <typename Strategy>
VisibleSelectionTemplate<Strategy>::VisibleSelectionTemplate()
: … { … }
template <typename Strategy>
VisibleSelectionTemplate<Strategy>::VisibleSelectionTemplate(
const SelectionTemplate<Strategy>& selection)
: … { … }
template <typename Strategy>
class VisibleSelectionTemplate<Strategy>::Creator { … };
VisibleSelection CreateVisibleSelection(const SelectionInDOMTree& selection) { … }
VisibleSelectionInFlatTree CreateVisibleSelection(
const SelectionInFlatTree& selection) { … }
SelectionInDOMTree ExpandWithGranularity(const SelectionInDOMTree& selection,
TextGranularity granularity,
const WordInclusion& inclusion) { … }
SelectionInFlatTree ExpandWithGranularity(const SelectionInFlatTree& selection,
TextGranularity granularity,
const WordInclusion& inclusion) { … }
template <typename Strategy>
VisibleSelectionTemplate<Strategy>::VisibleSelectionTemplate(
const VisibleSelectionTemplate<Strategy>& other)
: … { … }
template <typename Strategy>
VisibleSelectionTemplate<Strategy>& VisibleSelectionTemplate<Strategy>::
operator=(const VisibleSelectionTemplate<Strategy>& other) { … }
template <typename Strategy>
SelectionTemplate<Strategy> VisibleSelectionTemplate<Strategy>::AsSelection()
const { … }
template <typename Strategy>
bool VisibleSelectionTemplate<Strategy>::IsCaret() const { … }
template <typename Strategy>
bool VisibleSelectionTemplate<Strategy>::IsNone() const { … }
template <typename Strategy>
bool VisibleSelectionTemplate<Strategy>::IsRange() const { … }
template <typename Strategy>
PositionTemplate<Strategy> VisibleSelectionTemplate<Strategy>::Start() const { … }
template <typename Strategy>
PositionTemplate<Strategy> VisibleSelectionTemplate<Strategy>::End() const { … }
EphemeralRange FirstEphemeralRangeOf(const VisibleSelection& selection) { … }
template <typename Strategy>
EphemeralRangeTemplate<Strategy>
VisibleSelectionTemplate<Strategy>::ToNormalizedEphemeralRange() const { … }
template <typename Strategy>
static EphemeralRangeTemplate<Strategy> NormalizeRangeAlgorithm(
const SelectionTemplate<Strategy>& selection) { … }
EphemeralRange NormalizeRange(const SelectionInDOMTree& selection) { … }
EphemeralRangeInFlatTree NormalizeRange(const SelectionInFlatTree& selection) { … }
template <typename Strategy>
static SelectionTemplate<Strategy> CanonicalizeSelection(
const SelectionTemplate<Strategy>& selection) { … }
template <typename Strategy>
bool VisibleSelectionTemplate<Strategy>::IsValidFor(
const Document& document) const { … }
template <typename Strategy>
bool VisibleSelectionTemplate<Strategy>::IsContentEditable() const { … }
template <typename Strategy>
Element* VisibleSelectionTemplate<Strategy>::RootEditableElement() const { … }
template <typename Strategy>
static bool EqualSelectionsAlgorithm(
const VisibleSelectionTemplate<Strategy>& selection1,
const VisibleSelectionTemplate<Strategy>& selection2) { … }
template <typename Strategy>
bool VisibleSelectionTemplate<Strategy>::operator==(
const VisibleSelectionTemplate<Strategy>& other) const { … }
template <typename Strategy>
VisiblePositionTemplate<Strategy>
VisibleSelectionTemplate<Strategy>::VisibleStart() const { … }
template <typename Strategy>
VisiblePositionTemplate<Strategy>
VisibleSelectionTemplate<Strategy>::VisibleEnd() const { … }
template <typename Strategy>
VisiblePositionTemplate<Strategy>
VisibleSelectionTemplate<Strategy>::VisibleAnchor() const { … }
template <typename Strategy>
VisiblePositionTemplate<Strategy>
VisibleSelectionTemplate<Strategy>::VisibleFocus() const { … }
template <typename Strategy>
void VisibleSelectionTemplate<Strategy>::Trace(Visitor* visitor) const { … }
#if DCHECK_IS_ON()
template <typename Strategy>
void VisibleSelectionTemplate<Strategy>::ShowTreeForThis() const { … }
#endif
template <typename Strategy>
void VisibleSelectionTemplate<Strategy>::PrintTo(
const VisibleSelectionTemplate<Strategy>& selection,
std::ostream* ostream) { … }
template class CORE_TEMPLATE_EXPORT VisibleSelectionTemplate<EditingStrategy>;
template class CORE_TEMPLATE_EXPORT
VisibleSelectionTemplate<EditingInFlatTreeStrategy>;
std::ostream& operator<<(std::ostream& ostream,
const VisibleSelection& selection) { … }
std::ostream& operator<<(std::ostream& ostream,
const VisibleSelectionInFlatTree& selection) { … }
}
#if DCHECK_IS_ON()
void ShowTree(const blink::VisibleSelection& sel) { … }
void ShowTree(const blink::VisibleSelection* sel) { … }
void ShowTree(const blink::VisibleSelectionInFlatTree& sel) { … }
void ShowTree(const blink::VisibleSelectionInFlatTree* sel) { … }
#endif