#include "third_party/blink/renderer/core/editing/commands/insert_incremental_text_command.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/text.h"
#include "third_party/blink/renderer/core/editing/editing_utilities.h"
#include "third_party/blink/renderer/core/editing/editor.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/plain_text_range.h"
#include "third_party/blink/renderer/core/editing/selection_template.h"
#include "third_party/blink/renderer/core/editing/state_machines/forward_code_point_state_machine.h"
#include "third_party/blink/renderer/core/editing/visible_units.h"
#include "third_party/blink/renderer/core/html/html_span_element.h"
namespace blink {
namespace {
wtf_size_t ComputeCommonPrefixLength(const String& str1, const String& str2) { … }
wtf_size_t ComputeCommonSuffixLength(const String& str1, const String& str2) { … }
wtf_size_t ComputeCommonGraphemeClusterPrefixLength(
const Position& selection_start,
const String& old_text,
const String& new_text) { … }
wtf_size_t ComputeCommonGraphemeClusterSuffixLength(
const Position& selection_start,
const String& old_text,
const String& new_text) { … }
const String ComputeTextForInsertion(const String& new_text,
const wtf_size_t common_prefix_length,
const wtf_size_t common_suffix_length) { … }
SelectionInDOMTree ComputeSelectionForInsertion(
const EphemeralRange& selection_range,
const int offset,
const int length) { … }
}
InsertIncrementalTextCommand::InsertIncrementalTextCommand(
Document& document,
const String& text,
RebalanceType rebalance_type)
: … { … }
void InsertIncrementalTextCommand::DoApply(EditingState* editing_state) { … }
}