#include "third_party/blink/renderer/core/editing/editor.h"
#include "third_party/blink/public/web/web_local_frame_client.h"
#include "third_party/blink/renderer/core/accessibility/ax_object_cache.h"
#include "third_party/blink/renderer/core/clipboard/data_object.h"
#include "third_party/blink/renderer/core/clipboard/data_transfer.h"
#include "third_party/blink/renderer/core/clipboard/data_transfer_access_policy.h"
#include "third_party/blink/renderer/core/clipboard/system_clipboard.h"
#include "third_party/blink/renderer/core/css/css_computed_style_declaration.h"
#include "third_party/blink/renderer/core/css/css_property_names.h"
#include "third_party/blink/renderer/core/css/css_property_value_set.h"
#include "third_party/blink/renderer/core/dom/document_fragment.h"
#include "third_party/blink/renderer/core/dom/element_traversal.h"
#include "third_party/blink/renderer/core/dom/events/scoped_event_queue.h"
#include "third_party/blink/renderer/core/dom/node_traversal.h"
#include "third_party/blink/renderer/core/dom/parser_content_policy.h"
#include "third_party/blink/renderer/core/dom/text.h"
#include "third_party/blink/renderer/core/editing/commands/apply_style_command.h"
#include "third_party/blink/renderer/core/editing/commands/delete_selection_command.h"
#include "third_party/blink/renderer/core/editing/commands/indent_outdent_command.h"
#include "third_party/blink/renderer/core/editing/commands/insert_list_command.h"
#include "third_party/blink/renderer/core/editing/commands/replace_selection_command.h"
#include "third_party/blink/renderer/core/editing/commands/selection_for_undo_step.h"
#include "third_party/blink/renderer/core/editing/commands/simplify_markup_command.h"
#include "third_party/blink/renderer/core/editing/commands/typing_command.h"
#include "third_party/blink/renderer/core/editing/commands/undo_stack.h"
#include "third_party/blink/renderer/core/editing/editing_behavior.h"
#include "third_party/blink/renderer/core/editing/editing_style_utilities.h"
#include "third_party/blink/renderer/core/editing/editing_tri_state.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/finder/find_buffer.h"
#include "third_party/blink/renderer/core/editing/frame_selection.h"
#include "third_party/blink/renderer/core/editing/ime/input_method_controller.h"
#include "third_party/blink/renderer/core/editing/kill_ring.h"
#include "third_party/blink/renderer/core/editing/markers/document_marker.h"
#include "third_party/blink/renderer/core/editing/markers/document_marker_controller.h"
#include "third_party/blink/renderer/core/editing/selection_template.h"
#include "third_party/blink/renderer/core/editing/serializers/serialization.h"
#include "third_party/blink/renderer/core/editing/set_selection_options.h"
#include "third_party/blink/renderer/core/editing/spellcheck/spell_checker.h"
#include "third_party/blink/renderer/core/editing/visible_position.h"
#include "third_party/blink/renderer/core/editing/visible_units.h"
#include "third_party/blink/renderer/core/events/keyboard_event.h"
#include "third_party/blink/renderer/core/events/text_event.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/html/forms/html_input_element.h"
#include "third_party/blink/renderer/core/html/forms/html_text_area_element.h"
#include "third_party/blink/renderer/core/html/html_image_element.h"
#include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/core/input/event_handler.h"
#include "third_party/blink/renderer/core/input_type_names.h"
#include "third_party/blink/renderer/core/layout/hit_test_result.h"
#include "third_party/blink/renderer/core/loader/empty_clients.h"
#include "third_party/blink/renderer/core/loader/resource/image_resource_content.h"
#include "third_party/blink/renderer/core/page/drag_data.h"
#include "third_party/blink/renderer/core/page/focus_controller.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/core/scroll/scroll_alignment.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/weborigin/kurl.h"
#include "third_party/blink/renderer/platform/wtf/text/character_names.h"
namespace blink {
namespace {
bool IsInPasswordFieldWithUnrevealedPassword(const Position& position) { … }
}
SelectionInDOMTree Editor::SelectionForCommand(Event* event) { … }
EditingBehavior Editor::Behavior() const { … }
static bool IsCaretAtStartOfWrappedLine(const FrameSelection& selection) { … }
bool Editor::HandleTextEvent(TextEvent* event) { … }
bool Editor::CanEdit() const { … }
bool Editor::CanEditRichly() const { … }
bool Editor::CanCut() const { … }
bool Editor::CanCopy() const { … }
bool Editor::CanPaste() const { … }
bool Editor::CanDelete() const { … }
bool Editor::SmartInsertDeleteEnabled() const { … }
bool Editor::IsSelectTrailingWhitespaceEnabled() const { … }
void Editor::DeleteSelectionWithSmartDelete(
DeleteMode delete_mode,
InputEvent::InputType input_type,
const Position& reference_move_position) { … }
void Editor::ReplaceSelectionWithFragment(DocumentFragment* fragment,
bool select_replacement,
bool smart_replace,
bool match_style,
InputEvent::InputType input_type) { … }
void Editor::ReplaceSelectionWithText(const String& text,
bool select_replacement,
bool smart_replace,
InputEvent::InputType input_type) { … }
void Editor::ReplaceSelectionAfterDragging(DocumentFragment* fragment,
InsertMode insert_mode,
DragSourceType drag_source_type) { … }
bool Editor::DeleteSelectionAfterDraggingWithEvents(
Element* drag_source,
DeleteMode delete_mode,
const Position& reference_move_position) { … }
bool Editor::ReplaceSelectionAfterDraggingWithEvents(
Element* drop_target,
DragData* drag_data,
DocumentFragment* fragment,
Range* drop_caret_range,
InsertMode insert_mode,
DragSourceType drag_source_type) { … }
EphemeralRange Editor::SelectedRange() { … }
void Editor::RespondToChangedContents(const Position& position) { … }
void Editor::NotifyAccessibilityOfDeletionOrInsertionInTextField(
const SelectionForUndoStep& changed_selection,
bool is_deletion) { … }
void Editor::RegisterCommandGroup(CompositeEditCommand* command_group_wrapper) { … }
void Editor::ApplyParagraphStyle(CSSPropertyValueSet* style,
InputEvent::InputType input_type) { … }
void Editor::ApplyParagraphStyleToSelection(CSSPropertyValueSet* style,
InputEvent::InputType input_type) { … }
Editor::Editor(LocalFrame& frame)
: … { … }
Editor::~Editor() = default;
void Editor::Clear() { … }
bool Editor::InsertText(const String& text, KeyboardEvent* triggering_event) { … }
bool Editor::InsertTextWithoutSendingTextEvent(
const String& text,
bool select_inserted_text,
TextEvent* triggering_event,
InputEvent::InputType input_type) { … }
bool Editor::InsertLineBreak() { … }
bool Editor::InsertParagraphSeparator() { … }
static void CountEditingEvent(ExecutionContext* execution_context,
const Event& event,
WebFeature feature_on_input,
WebFeature feature_on_text_area,
WebFeature feature_on_content_editable,
WebFeature feature_on_non_node) { … }
void Editor::CountEvent(ExecutionContext* execution_context,
const Event& event) { … }
void Editor::CopyImage(const HitTestResult& result) { … }
void Editor::CopyImage(const HitTestResult& result,
const scoped_refptr<Image>& image) { … }
bool Editor::CanUndo() { … }
void Editor::Undo() { … }
bool Editor::CanRedo() { … }
void Editor::Redo() { … }
void Editor::SetBaseWritingDirection(
mojo_base::mojom::blink::TextDirection direction) { … }
void Editor::RevealSelectionAfterEditingOperation(
const mojom::blink::ScrollAlignment& alignment) { … }
void Editor::AddImageResourceObserver(ImageResourceObserver* observer) { … }
void Editor::RemoveImageResourceObserver(ImageResourceObserver* observer) { … }
void Editor::AddToKillRing(const EphemeralRange& range) { … }
EphemeralRange Editor::RangeForPoint(const gfx::Point& frame_point) const { … }
EphemeralRange Editor::RangeBetweenPoints(const gfx::Point& start_point,
const gfx::Point& end_point) const { … }
void Editor::ComputeAndSetTypingStyle(CSSPropertyValueSet* style,
InputEvent::InputType input_type) { … }
bool Editor::FindString(LocalFrame& frame,
const String& target,
FindOptions options) { … }
static Range* FindStringBetweenPositions(
const String& target,
const EphemeralRangeInFlatTree& reference_range,
FindOptions options) { … }
Range* Editor::FindRangeOfString(
Document& document,
const String& target,
const EphemeralRangeInFlatTree& reference_range,
FindOptions options,
bool* wrapped_around) { … }
void Editor::SetMarkedTextMatchesAreHighlighted(bool flag) { … }
void Editor::RespondToChangedSelection() { … }
void Editor::SyncSelection(SyncCondition force_sync) { … }
SpellChecker& Editor::GetSpellChecker() const { … }
FrameSelection& Editor::GetFrameSelection() const { … }
void Editor::SetMark() { … }
void Editor::ReplaceSelection(const String& text) { … }
void Editor::ElementRemoved(Element* element) { … }
void Editor::Trace(Visitor* visitor) const { … }
}