#include "third_party/blink/renderer/core/editing/finder/find_buffer.h"
#include "base/time/time.h"
#include "third_party/blink/renderer/core/css/style_change_reason.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/node_computed_style.h"
#include "third_party/blink/renderer/core/dom/range.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/ephemeral_range.h"
#include "third_party/blink/renderer/core/editing/iterators/text_searcher_icu.h"
#include "third_party/blink/renderer/core/fullscreen/fullscreen.h"
#include "third_party/blink/renderer/core/html/forms/html_form_control_element.h"
#include "third_party/blink/renderer/core/html/forms/html_input_element.h"
#include "third_party/blink/renderer/core/html/forms/html_select_element.h"
#include "third_party/blink/renderer/core/html/forms/text_control_element.h"
#include "third_party/blink/renderer/core/html/html_dialog_element.h"
#include "third_party/blink/renderer/core/html/html_iframe_element.h"
#include "third_party/blink/renderer/core/html/html_image_element.h"
#include "third_party/blink/renderer/core/html/html_meter_element.h"
#include "third_party/blink/renderer/core/html/html_object_element.h"
#include "third_party/blink/renderer/core/html/html_progress_element.h"
#include "third_party/blink/renderer/core/html/html_script_element.h"
#include "third_party/blink/renderer/core/html/html_style_element.h"
#include "third_party/blink/renderer/core/html/html_wbr_element.h"
#include "third_party/blink/renderer/core/html/media/html_audio_element.h"
#include "third_party/blink/renderer/core/html/media/html_video_element.h"
#include "third_party/blink/renderer/core/layout/inline/inline_node.h"
#include "third_party/blink/renderer/core/layout/inline/offset_mapping.h"
#include "third_party/blink/renderer/core/layout/layout_block_flow.h"
#include "third_party/blink/renderer/core/layout/layout_object.h"
#include "third_party/blink/renderer/core/style/computed_style.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/text/unicode_utilities.h"
#include "third_party/blink/renderer/platform/wtf/text/character_names.h"
#include "third_party/blink/renderer/platform/wtf/text/unicode.h"
namespace blink {
namespace {
bool ShouldIgnoreContents(const Node& node) { … }
Node* GetOutermostNonSearchableAncestor(const Node& node) { … }
const ComputedStyle* EnsureComputedStyleForFind(Node& node) { … }
template <class Direction>
Node* GetVisibleTextNode(Node& start_node) { … }
bool IsExplicitFindBoundary(const Node& node) { … }
bool AreInOrder(const Node& start, const Node& end) { … }
}
FindBuffer::FindBuffer(const EphemeralRangeInFlatTree& range) { … }
bool FindBuffer::IsInvalidMatch(MatchResultICU match) const { … }
EphemeralRangeInFlatTree FindBuffer::FindMatchInRange(
const EphemeralRangeInFlatTree& range,
String search_text,
FindOptions options,
std::optional<base::TimeDelta> timeout_ms) { … }
const Node& FindBuffer::GetFirstBlockLevelAncestorInclusive(const Node& node) { … }
bool FindBuffer::IsInSameUninterruptedBlock(const Node& start_node,
const Node& end_node) { … }
Node* FindBuffer::ForwardVisibleTextNode(Node& start_node) { … }
Node* FindBuffer::BackwardVisibleTextNode(Node& start_node) { … }
FindBuffer::Results FindBuffer::FindMatches(const WebString& search_text,
const blink::FindOptions options) { … }
void FindBuffer::CollectTextUntilBlockBoundary(
const EphemeralRangeInFlatTree& range) { … }
void FindBuffer::ReplaceNodeWithCharConstants(const Node& node) { … }
EphemeralRangeInFlatTree FindBuffer::RangeFromBufferIndex(
unsigned start_index,
unsigned end_index) const { … }
const FindBuffer::BufferNodeMapping* FindBuffer::MappingForIndex(
unsigned index) const { … }
PositionInFlatTree FindBuffer::PositionAtStartOfCharacterAtIndex(
unsigned index) const { … }
PositionInFlatTree FindBuffer::PositionAtEndOfCharacterAtIndex(
unsigned index) const { … }
void FindBuffer::AddTextToBuffer(const Text& text_node,
LayoutBlockFlow& block_flow,
const EphemeralRangeInFlatTree& range) { … }
FindBuffer::Results::Results() { … }
FindBuffer::Results::Results(const FindBuffer& find_buffer,
TextSearcherICU* text_searcher,
const Vector<UChar>& buffer,
const String& search_text,
const blink::FindOptions options) { … }
FindBuffer::Results::Iterator FindBuffer::Results::begin() const { … }
FindBuffer::Results::Iterator FindBuffer::Results::end() const { … }
bool FindBuffer::Results::IsEmpty() const { … }
FindBuffer::BufferMatchResult FindBuffer::Results::front() const { … }
FindBuffer::BufferMatchResult FindBuffer::Results::back() const { … }
unsigned FindBuffer::Results::CountForTesting() const { … }
FindBuffer::Results::Iterator::Iterator(const FindBuffer& find_buffer,
TextSearcherICU* text_searcher)
: … { … }
const FindBuffer::BufferMatchResult FindBuffer::Results::Iterator::operator*()
const { … }
void FindBuffer::Results::Iterator::operator++() { … }
}