#include "third_party/blink/renderer/core/editing/commands/delete_selection_command.h"
#include "base/ranges/algorithm.h"
#include "build/build_config.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/node_traversal.h"
#include "third_party/blink/renderer/core/dom/text.h"
#include "third_party/blink/renderer/core/editing/commands/editing_commands_utilities.h"
#include "third_party/blink/renderer/core/editing/editing_boundary.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/local_caret_rect.h"
#include "third_party/blink/renderer/core/editing/relocatable_position.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/core/editing/visible_units.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/html/forms/html_input_element.h"
#include "third_party/blink/renderer/core/html/html_br_element.h"
#include "third_party/blink/renderer/core/html/html_hr_element.h"
#include "third_party/blink/renderer/core/html/html_link_element.h"
#include "third_party/blink/renderer/core/html/html_style_element.h"
#include "third_party/blink/renderer/core/html/html_table_element.h"
#include "third_party/blink/renderer/core/html/html_table_row_element.h"
#include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/core/layout/layout_box.h"
#include "third_party/blink/renderer/core/layout/layout_text.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
namespace blink {
static bool IsTableCellEmpty(Node* cell) { … }
static bool IsTableRowEmpty(Node* row) { … }
static bool CanMergeListElements(Element* first_list, Element* second_list) { … }
DeleteSelectionCommand::DeleteSelectionCommand(
Document& document,
const DeleteSelectionOptions& options,
InputEvent::InputType input_type,
const Position& reference_move_position)
: … { … }
DeleteSelectionCommand::DeleteSelectionCommand(
const SelectionForUndoStep& selection,
const DeleteSelectionOptions& options,
InputEvent::InputType input_type)
: … { … }
void DeleteSelectionCommand::InitializeStartEnd(Position& start,
Position& end) { … }
void DeleteSelectionCommand::SetStartingSelectionOnSmartDelete(
const Position& start,
const Position& end) { … }
static Position TrailingWhitespacePosition(const Position& position,
WhitespacePositionOption option) { … }
#if defined(COMPILER_GCC)
static bool IsHTMLTableRowElement(const blink::Node* node) { … }
#endif
void DeleteSelectionCommand::InitializePositionData(
EditingState* editing_state) { … }
static bool ShouldNotInheritStyleFrom(const Node& node) { … }
void DeleteSelectionCommand::SaveTypingStyleState() { … }
bool DeleteSelectionCommand::HandleSpecialCaseBRDelete(
EditingState* editing_state) { … }
static Position FirstEditablePositionInNode(Node* node) { … }
void DeleteSelectionCommand::RemoveNode(
Node* node,
EditingState* editing_state,
ShouldAssumeContentIsAlwaysEditable
should_assume_content_is_always_editable) { … }
void DeleteSelectionCommand::RemoveCompletelySelectedNodes(
Node* start_node,
EditingState* editing_state) { … }
static void UpdatePositionForTextRemoval(Text* node,
int offset,
int count,
Position& position) { … }
void DeleteSelectionCommand::DeleteTextFromNode(Text* node,
unsigned offset,
unsigned count) { … }
void DeleteSelectionCommand::
MakeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss(
EditingState* editing_state) { … }
void DeleteSelectionCommand::HandleGeneralDelete(EditingState* editing_state) { … }
void DeleteSelectionCommand::FixupWhitespace(const Position& position) { … }
void DeleteSelectionCommand::MergeParagraphs(EditingState* editing_state) { … }
void DeleteSelectionCommand::RemovePreviouslySelectedEmptyTableRows(
EditingState* editing_state) { … }
void DeleteSelectionCommand::CalculateTypingStyleAfterDelete() { … }
void DeleteSelectionCommand::ClearTransientState() { … }
void DeleteSelectionCommand::RemoveRedundantBlocks(
EditingState* editing_state) { … }
void DeleteSelectionCommand::DoApply(EditingState* editing_state) { … }
InputEvent::InputType DeleteSelectionCommand::GetInputType() const { … }
bool DeleteSelectionCommand::PreservesTypingStyle() const { … }
void DeleteSelectionCommand::Trace(Visitor* visitor) const { … }
}