зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1463985 - part 23: Rename EditSubAction::htmlPaste and EditSubAction::loadHTML to EditSubAction::ePasteHTMLContent and EditSubAction::eInsertHTMLSource r=m_kato
MozReview-Commit-ID: B1Ag1yP5PXl --HG-- extra : rebase_source : 47b20d72c53f8c97c4ccbb20960d5bf571d9cde6
This commit is contained in:
Родитель
4db8c8a594
Коммит
a9c4b1bc58
|
@ -99,8 +99,13 @@ enum class EditSubAction : int32_t
|
|||
// eInsertQuotation indicates to insert an element and make it "quoted text".
|
||||
eInsertQuotation,
|
||||
|
||||
htmlPaste = 3012,
|
||||
loadHTML,
|
||||
// ePasteHTMLContent indicates to paste HTML content in clipboard.
|
||||
ePasteHTMLContent,
|
||||
|
||||
// eInsertHTMLSource indicates to create a document fragment from given HTML
|
||||
// source and insert into the DOM tree. So, this is similar to innerHTML.
|
||||
eInsertHTMLSource,
|
||||
|
||||
resetTextProperties,
|
||||
setAbsolutePosition,
|
||||
removeAbsolutePosition,
|
||||
|
|
|
@ -498,9 +498,9 @@ HTMLEditRules::AfterEditInner(EditSubAction aEditSubAction,
|
|||
// if we did a ranged deletion or handling backspace key, make sure we have
|
||||
// a place to put caret.
|
||||
// Note we only want to do this if the overall operation was deletion,
|
||||
// not if deletion was done along the way for EditSubAction::loadHTML,
|
||||
// EditSubAction::eInsertText, etc. That's why this is here rather than
|
||||
// DidDeleteSelection().
|
||||
// not if deletion was done along the way for
|
||||
// EditSubAction::eInsertHTMLSource, EditSubAction::eInsertText, etc.
|
||||
// That's why this is here rather than DidDeleteSelection().
|
||||
if (aEditSubAction == EditSubAction::eDeleteSelectedContent &&
|
||||
mDidRangedDelete) {
|
||||
nsresult rv = InsertBRIfNeeded();
|
||||
|
@ -540,8 +540,8 @@ HTMLEditRules::AfterEditInner(EditSubAction aEditSubAction,
|
|||
aEditSubAction == EditSubAction::eInsertTextComingFromIME ||
|
||||
aEditSubAction == EditSubAction::eDeleteSelectedContent ||
|
||||
aEditSubAction == EditSubAction::eInsertParagraphSeparator ||
|
||||
aEditSubAction == EditSubAction::htmlPaste ||
|
||||
aEditSubAction == EditSubAction::loadHTML) {
|
||||
aEditSubAction == EditSubAction::ePasteHTMLContent ||
|
||||
aEditSubAction == EditSubAction::eInsertHTMLSource) {
|
||||
rv = AdjustWhitespace();
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
|
@ -576,8 +576,8 @@ HTMLEditRules::AfterEditInner(EditSubAction aEditSubAction,
|
|||
aEditSubAction == EditSubAction::eInsertTextComingFromIME ||
|
||||
aEditSubAction == EditSubAction::eDeleteSelectedContent ||
|
||||
aEditSubAction == EditSubAction::eInsertParagraphSeparator ||
|
||||
aEditSubAction == EditSubAction::htmlPaste ||
|
||||
aEditSubAction == EditSubAction::loadHTML) {
|
||||
aEditSubAction == EditSubAction::ePasteHTMLContent ||
|
||||
aEditSubAction == EditSubAction::eInsertHTMLSource) {
|
||||
rv = AdjustSelection(aDirection);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
|
@ -687,7 +687,7 @@ HTMLEditRules::WillDoAction(Selection* aSelection,
|
|||
return WillInsertText(aInfo.mEditSubAction, aCancel, aHandled,
|
||||
aInfo.inString, aInfo.outString,
|
||||
aInfo.maxLength);
|
||||
case EditSubAction::loadHTML:
|
||||
case EditSubAction::eInsertHTMLSource:
|
||||
return WillLoadHTML();
|
||||
case EditSubAction::eInsertParagraphSeparator:
|
||||
UndefineCaretBidiLevel();
|
||||
|
|
|
@ -93,14 +93,15 @@ HTMLEditor::LoadHTML(const nsAString& aInputString)
|
|||
CommitComposition();
|
||||
AutoPlaceholderBatch beginBatching(this);
|
||||
AutoTopLevelEditSubActionNotifier maybeTopLevelEditSubAction(
|
||||
*this, EditSubAction::loadHTML,
|
||||
*this,
|
||||
EditSubAction::eInsertHTMLSource,
|
||||
nsIEditor::eNext);
|
||||
|
||||
// Get selection
|
||||
RefPtr<Selection> selection = GetSelection();
|
||||
NS_ENSURE_STATE(selection);
|
||||
|
||||
EditSubActionInfo subActionInfo(EditSubAction::loadHTML);
|
||||
EditSubActionInfo subActionInfo(EditSubAction::eInsertHTMLSource);
|
||||
bool cancel, handled;
|
||||
// Protect the edit rules object from dying
|
||||
RefPtr<TextEditRules> rules(mRules);
|
||||
|
@ -213,7 +214,7 @@ HTMLEditor::DoInsertHTMLWithContext(const nsAString& aInputString,
|
|||
CommitComposition();
|
||||
AutoPlaceholderBatch beginBatching(this);
|
||||
AutoTopLevelEditSubActionNotifier maybeTopLevelEditSubAction(
|
||||
*this, EditSubAction::htmlPaste,
|
||||
*this, EditSubAction::ePasteHTMLContent,
|
||||
nsIEditor::eNext);
|
||||
|
||||
// Get selection
|
||||
|
|
Загрузка…
Ссылка в новой задаче