chromium/third_party/blink/renderer/core/editing/commands/delete_selection_command.cc

/*
 * Copyright (C) 2005 Apple Computer, Inc.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#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) {}

// This assumes that it starts in editable content.
static Position TrailingWhitespacePosition(const Position& position,
                                           WhitespacePositionOption option) {}

// Workaround: GCC fails to resolve overloaded template functions, passed as
// parameters of EnclosingNodeType. But it works wrapping that in a utility
// function.
#if defined(COMPILER_GCC)
static bool IsHTMLTableRowElement(const blink::Node* node) {}
#endif

void DeleteSelectionCommand::InitializePositionData(
    EditingState* editing_state) {}

// We don't want to inherit style from an element which can't have contents.
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) {}

// If a selection starts in one block and ends in another, we have to merge to
// bring content before the start together with content after the end.
void DeleteSelectionCommand::MergeParagraphs(EditingState* editing_state) {}

void DeleteSelectionCommand::RemovePreviouslySelectedEmptyTableRows(
    EditingState* editing_state) {}

void DeleteSelectionCommand::CalculateTypingStyleAfterDelete() {}

void DeleteSelectionCommand::ClearTransientState() {}

// This method removes div elements with no attributes that have only one child
// or no children at all.
void DeleteSelectionCommand::RemoveRedundantBlocks(
    EditingState* editing_state) {}

void DeleteSelectionCommand::DoApply(EditingState* editing_state) {}

InputEvent::InputType DeleteSelectionCommand::GetInputType() const {}

// Normally deletion doesn't preserve the typing style that was present before
// it.  For example, type a character, Bold, then delete the character and start
// typing.  The Bold typing style shouldn't stick around.  Deletion should
// preserve a typing style that *it* sets, however.
bool DeleteSelectionCommand::PreservesTypingStyle() const {}

void DeleteSelectionCommand::Trace(Visitor* visitor) const {}

}  // namespace blink