| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 #include "core/editing/commands/CompositeEditCommand.h" | 29 #include "core/editing/commands/CompositeEditCommand.h" |
| 30 | 30 |
| 31 namespace blink { | 31 namespace blink { |
| 32 | 32 |
| 33 class EditingStyle; | 33 class EditingStyle; |
| 34 class HTMLTableRowElement; | 34 class HTMLTableRowElement; |
| 35 | 35 |
| 36 class DeleteSelectionCommand final : public CompositeEditCommand { | 36 class DeleteSelectionCommand final : public CompositeEditCommand { |
| 37 public: | 37 public: |
| 38 static DeleteSelectionCommand* create(Document& document, bool smartDelete =
false, bool mergeBlocksAfterDelete = true, bool expandForSpecialElements = fals
e, bool sanitizeMarkup = true, InputEvent::InputType inputType = InputEvent::Inp
utType::None) | 38 static DeleteSelectionCommand* create(Document& document, bool smartDelete =
false, bool mergeBlocksAfterDelete = true, bool expandForSpecialElements = fals
e, bool sanitizeMarkup = true, InputEvent::InputType inputType = InputEvent::Inp
utType::None, const Position& referenceMovePosition = Position()) |
| 39 { | 39 { |
| 40 return new DeleteSelectionCommand(document, smartDelete, mergeBlocksAfte
rDelete, expandForSpecialElements, sanitizeMarkup, inputType); | 40 return new DeleteSelectionCommand(document, smartDelete, mergeBlocksAfte
rDelete, expandForSpecialElements, sanitizeMarkup, inputType, referenceMovePosit
ion); |
| 41 } | 41 } |
| 42 static DeleteSelectionCommand* create(const VisibleSelection& selection, boo
l smartDelete = false, bool mergeBlocksAfterDelete = true, bool expandForSpecial
Elements = false, bool sanitizeMarkup = true, InputEvent::InputType inputType =
InputEvent::InputType::None) | 42 static DeleteSelectionCommand* create(const VisibleSelection& selection, boo
l smartDelete = false, bool mergeBlocksAfterDelete = true, bool expandForSpecial
Elements = false, bool sanitizeMarkup = true, InputEvent::InputType inputType =
InputEvent::InputType::None) |
| 43 { | 43 { |
| 44 return new DeleteSelectionCommand(selection, smartDelete, mergeBlocksAft
erDelete, expandForSpecialElements, sanitizeMarkup, inputType); | 44 return new DeleteSelectionCommand(selection, smartDelete, mergeBlocksAft
erDelete, expandForSpecialElements, sanitizeMarkup, inputType); |
| 45 } | 45 } |
| 46 | 46 |
| 47 DECLARE_VIRTUAL_TRACE(); | 47 DECLARE_VIRTUAL_TRACE(); |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 DeleteSelectionCommand(Document&, bool smartDelete, bool mergeBlocksAfterDel
ete, bool expandForSpecialElements, bool santizeMarkup, InputEvent::InputType); | 50 DeleteSelectionCommand(Document&, bool smartDelete, bool mergeBlocksAfterDel
ete, bool expandForSpecialElements, bool santizeMarkup, InputEvent::InputType, c
onst Position& referenceMovePosition); |
| 51 DeleteSelectionCommand(const VisibleSelection&, bool smartDelete, bool merge
BlocksAfterDelete, bool expandForSpecialElements, bool sanitizeMarkup, InputEven
t::InputType); | 51 DeleteSelectionCommand(const VisibleSelection&, bool smartDelete, bool merge
BlocksAfterDelete, bool expandForSpecialElements, bool sanitizeMarkup, InputEven
t::InputType); |
| 52 | 52 |
| 53 void doApply(EditingState*) override; | 53 void doApply(EditingState*) override; |
| 54 InputEvent::InputType inputType() const override; | 54 InputEvent::InputType inputType() const override; |
| 55 | 55 |
| 56 bool preservesTypingStyle() const override; | 56 bool preservesTypingStyle() const override; |
| 57 | 57 |
| 58 void initializeStartEnd(Position&, Position&); | 58 void initializeStartEnd(Position&, Position&); |
| 59 void setStartingSelectionOnSmartDelete(const Position&, const Position&); | 59 void setStartingSelectionOnSmartDelete(const Position&, const Position&); |
| 60 void initializePositionData(EditingState*); | 60 void initializePositionData(EditingState*); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 83 | 83 |
| 84 // This data is transient and should be cleared at the end of the doApply fu
nction. | 84 // This data is transient and should be cleared at the end of the doApply fu
nction. |
| 85 VisibleSelection m_selectionToDelete; | 85 VisibleSelection m_selectionToDelete; |
| 86 Position m_upstreamStart; | 86 Position m_upstreamStart; |
| 87 Position m_downstreamStart; | 87 Position m_downstreamStart; |
| 88 Position m_upstreamEnd; | 88 Position m_upstreamEnd; |
| 89 Position m_downstreamEnd; | 89 Position m_downstreamEnd; |
| 90 Position m_endingPosition; | 90 Position m_endingPosition; |
| 91 Position m_leadingWhitespace; | 91 Position m_leadingWhitespace; |
| 92 Position m_trailingWhitespace; | 92 Position m_trailingWhitespace; |
| 93 Position m_referenceMovePosition; |
| 93 Member<Node> m_startBlock; | 94 Member<Node> m_startBlock; |
| 94 Member<Node> m_endBlock; | 95 Member<Node> m_endBlock; |
| 95 Member<EditingStyle> m_typingStyle; | 96 Member<EditingStyle> m_typingStyle; |
| 96 Member<EditingStyle> m_deleteIntoBlockquoteStyle; | 97 Member<EditingStyle> m_deleteIntoBlockquoteStyle; |
| 97 Member<Element> m_startRoot; | 98 Member<Element> m_startRoot; |
| 98 Member<Element> m_endRoot; | 99 Member<Element> m_endRoot; |
| 99 Member<HTMLTableRowElement> m_startTableRow; | 100 Member<HTMLTableRowElement> m_startTableRow; |
| 100 Member<HTMLTableRowElement> m_endTableRow; | 101 Member<HTMLTableRowElement> m_endTableRow; |
| 101 Member<Node> m_temporaryPlaceholder; | 102 Member<Node> m_temporaryPlaceholder; |
| 102 }; | 103 }; |
| 103 | 104 |
| 104 } // namespace blink | 105 } // namespace blink |
| 105 | 106 |
| 106 #endif // DeleteSelectionCommand_h | 107 #endif // DeleteSelectionCommand_h |
| OLD | NEW |