#include "third_party/blink/renderer/core/fragment_directive/text_fragment_finder.h"
#include <memory>
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/renderer/core/display_lock/display_lock_document_state.h"
#include "third_party/blink/renderer/core/dom/document.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/finder/async_find_buffer.h"
#include "third_party/blink/renderer/core/editing/finder/find_buffer.h"
#include "third_party/blink/renderer/core/editing/finder/find_options.h"
#include "third_party/blink/renderer/core/editing/finder/sync_find_buffer.h"
#include "third_party/blink/renderer/core/editing/iterators/backwards_character_iterator.h"
#include "third_party/blink/renderer/core/editing/iterators/character_iterator.h"
#include "third_party/blink/renderer/core/fragment_directive/text_fragment_selector.h"
#include "third_party/blink/renderer/core/html/list_item_ordinal.h"
#include "third_party/blink/renderer/platform/text/text_boundaries.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
namespace blink {
namespace {
bool IsWordBounded(EphemeralRangeInFlatTree range, bool start, bool end) { … }
PositionInFlatTree FirstWordBoundaryAfter(PositionInFlatTree position) { … }
}
PositionInFlatTree TextFragmentFinder::NextTextPosition(
PositionInFlatTree position,
PositionInFlatTree end_position) { … }
PositionInFlatTree TextFragmentFinder::PreviousTextPosition(
PositionInFlatTree position,
PositionInFlatTree max_position) { … }
void TextFragmentFinder::OnFindMatchInRangeComplete(
String search_text,
RangeInFlatTree* search_range,
bool word_start_bounded,
bool word_end_bounded,
const EphemeralRangeInFlatTree& match) { … }
void TextFragmentFinder::FindMatchInRange(String search_text,
RangeInFlatTree* search_range,
bool word_start_bounded,
bool word_end_bounded) { … }
void TextFragmentFinder::FindPrefix() { … }
void TextFragmentFinder::OnPrefixMatchComplete(
EphemeralRangeInFlatTree prefix_match) { … }
void TextFragmentFinder::FindTextStart() { … }
void TextFragmentFinder::OnTextStartMatchComplete(
EphemeralRangeInFlatTree potential_match) { … }
void TextFragmentFinder::FindTextEnd() { … }
void TextFragmentFinder::OnTextEndMatchComplete(
EphemeralRangeInFlatTree text_end_match) { … }
void TextFragmentFinder::FindSuffix() { … }
void TextFragmentFinder::OnSuffixMatchComplete(
EphemeralRangeInFlatTree suffix_match) { … }
void TextFragmentFinder::GoToStep(SelectorMatchStep step) { … }
bool TextFragmentFinder::IsInSameUninterruptedBlock(
const PositionInFlatTree& start,
const PositionInFlatTree& end) { … }
TextFragmentFinder::TextFragmentFinder(Client& client,
const TextFragmentSelector& selector,
Document* document,
FindBufferRunnerType runner_type)
: … { … }
void TextFragmentFinder::Cancel() { … }
void TextFragmentFinder::FindMatch() { … }
void TextFragmentFinder::FindMatchFromPosition(
PositionInFlatTree search_start) { … }
void TextFragmentFinder::OnMatchComplete() { … }
void TextFragmentFinder::Trace(Visitor* visitor) const { … }
void TextFragmentFinder::SetPotentialMatch(EphemeralRangeInFlatTree range) { … }
void TextFragmentFinder::SetPrefixMatch(EphemeralRangeInFlatTree range) { … }
bool TextFragmentFinder::HasValidRanges() { … }
}