Граф коммитов

36 Коммитов

Автор SHA1 Сообщение Дата
Masayuki Nakano 9b49e5d514 Bug 1503473 - part 4: Create a new path to handle Enter key press in TextEditor r=m_kato
This patch creates new path to insert a line break in TextEditor.

Declares new EditSubAction::eInsertLineBreak and makes the path use
EditAction::eInsertLineBreak instead of EditAction::eInsertParagraphSeparator.

Unfortunately, this patch makes TextEditor::InsertLineBreakAsAction() as
a virtual method for keeping this change as small as possible.

Differential Revision: https://phabricator.services.mozilla.com/D10524

--HG--
extra : moz-landing-system : lando
2018-11-03 11:22:13 +00:00
Cosmin Sabou 7da86ef60f Backed out 5 changesets (bug 1503473) for crashes in Thunderbird on request of jorgk. a=backout
Backed out changeset a7f7d9f366b9 (bug 1503473)
Backed out changeset d067907793ef (bug 1503473)
Backed out changeset 130ba0de053f (bug 1503473)
Backed out changeset ec732243e9ad (bug 1503473)
Backed out changeset 13511cab2b41 (bug 1503473)
2018-11-03 02:08:42 +02:00
Masayuki Nakano b1587d8dd4 Bug 1503473 - part 4: Create a new path to handle Enter key press in TextEditor r=m_kato
This patch creates new path to insert a line break in TextEditor.

Declares new EditSubAction::eInsertLineBreak and makes the path use
EditAction::eInsertLineBreak instead of EditAction::eInsertParagraphSeparator.

Unfortunately, this patch makes TextEditor::InsertLineBreakAsAction() as
a virtual method for keeping this change as small as possible.

Differential Revision: https://phabricator.services.mozilla.com/D10524

--HG--
extra : moz-landing-system : lando
2018-11-02 13:10:43 +00:00
Masayuki Nakano 63f8b9a61d Bug 1503457 - Add some variation of EditAction values for composition r=m_kato
Input Events Level 2 declares "deleteByComposition" for empty composition
removes selected content and "deleteCompositionText" for canceling composition.
https://w3c.github.io/input-events/#interface-InputEvent-Attributes

Therefore, TextEditor::OnCompositionChange() should use a new EditAction for
the former only when new composition string is empty, there is no composition
string and there is non-collapsed Selection.

And also TextEditor::OnCompositionEnd() should use another new EditAction for
the latter when composition is canceled with empty string (we don't restore
selected content which is removed by the composition).

Additionally, due to bug 1305387, we don't dispatch "input" event when
we handle TextEditor::OnCompositionChange().  Instead, we dispatch it
when we handle TextEditor::OnCompositionEnd().  Therefore, we need to
use EditAction::eCommitComposition in TextEditor::OnCompositionEnd().

Differential Revision: https://phabricator.services.mozilla.com/D10520

--HG--
extra : moz-landing-system : lando
2018-11-01 08:07:04 +00:00
Masayuki Nakano 41166eca5f Bug 1465702 - part 4: Make public methods of HTMLEditor create AutoEditActionDataSetter if necessary r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D10008

--HG--
extra : moz-landing-system : lando
2018-10-30 10:00:17 +00:00
Masayuki Nakano 062a07e7b0 Bug 1465702 - part 3: Make public methods of TextEditor create AutoEditActionDataSetter if necessary r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D10007

--HG--
extra : moz-landing-system : lando
2018-10-30 09:59:33 +00:00
Masayuki Nakano 779965a889 Bug 1465702 - part 2: Make public methods of EditorBase create AutoEditActionDataSetter if necessary r=m_kato
This patch makes public methods of EditorBase create AutoEditActionDataSetter
as far as possible.  However, does not do so for some public methods if they are
not necessary to create it.

Differential Revision: https://phabricator.services.mozilla.com/D10006

--HG--
extra : moz-landing-system : lando
2018-10-30 09:57:52 +00:00
Masayuki Nakano 7f8df77fb6 Bug 1465702 - part 1: Add EditorBase::AutoEditActionDataSetter to store edit action and grab Selection instance while editor classes handle an edit action r=m_kato
Like TextEditRules, EditorBase should have a stack class which cache necessary
objects and current handling edit action.  The edit action will be necessary
when we implement InputEvent.inputType.

Different from TextEditRules, this adds |const RefPtr<Selection>&| instead
of |Selection&|.  The reason is, when I add MOZ_CAN_RUN_SCRIPT to some methods,
it's not allowed like this:

> foo->CanRunScriptMethod(SelectionRef());

I'll update TextEditRules for consistency in the following patches.

Differential Revision: https://phabricator.services.mozilla.com/D10005

--HG--
extra : moz-landing-system : lando
2018-10-30 09:56:41 +00:00
Masayuki Nakano 908dbbfada Bug 1463985 - part 27: Replace EditSubAction::ignore with EditSubAction::eReplaceHeadWithHTMLSource and EditSubAction::eCreateBogusNode r=m_kato
EditSubAction::ignore is declared for making HTMLEditRules::AfterEditInner()
ignores post-processing of handling edit action.  Currently, this is used only
by TextEditRules::CreateBogusNodeIfNeeded() and
HTMLEditor::ReplaceHeadContentsWithHTML().  So, we should make them use
specific EditSubAction values which explain what they do and make
HTMLEditRules::AfterEditInner() ignore both of them.

MozReview-Commit-ID: JSHcgPfTrOE

--HG--
extra : rebase_source : c054c2db257dda7e1e3ace01f8e8831e07268f7e
2018-05-29 00:06:24 +09:00
Masayuki Nakano cc803498e8 Bug 1463985 - part 26: Rename EditSubAction::decreaseZIndex and EditSubAction::increaseZIndex to EditSubAction::eDecreaseZIndex and EditSubAction::eIncreaseZIndex r=m_kato
MozReview-Commit-ID: 87Pux0xZOM

--HG--
extra : rebase_source : cc89eb98558b32e31867ef9f6b1ab74acabadea5
2018-05-28 23:52:16 +09:00
Masayuki Nakano 0fe0c32b1a Bug 1463985 - part 25: Rename EditSubAction::setAbsolutePosition and EditSubAction::removeAbsolutePosition to EditSubAction::eSetPositionToAbsolute and EditSubAction::eSetPositionToStatic r=m_kato
MozReview-Commit-ID: DiyCAkGw2uo

--HG--
extra : rebase_source : e10f7af40ac3a21350526f803801683de5696182
2018-05-28 23:48:39 +09:00
Masayuki Nakano a48c9c34aa Bug 1463985 - part 24: Rename EditSubAction::resetTextProperties to EditSubAction::eRemoveAllTextProperties r=m_kato
MozReview-Commit-ID: 1QKUg361MSY

--HG--
extra : rebase_source : 7ed2f41e20e498e105fac8a88be90157dd812fa1
2018-05-28 23:40:45 +09:00
Masayuki Nakano a9c4b1bc58 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
2018-05-28 23:37:12 +09:00
Masayuki Nakano 4db8c8a594 Bug 1463985 - part 22: Rename EditSubAction::insertQuotation to EditSubAction::eInsertQuotation r=m_kato
According to this usage, perhaps, we can remove this from EditSubAction and
this should be moved to new EditAction.

MozReview-Commit-ID: HzfcC051rNB

--HG--
extra : rebase_source : e42cade8436b082b4dc2adfcbbac75e17779cfd7
2018-05-28 23:22:19 +09:00
Masayuki Nakano 84aca99c88 Bug 1463985 - part 21: Rename EditSubAction::insertElement to EditSubAction::eInsertElement r=m_kato
MozReview-Commit-ID: 6nrm1zJ968f

--HG--
extra : rebase_source : 633824e9564dddd9d9b80414ab07e7aa960b8fb1
2018-05-28 23:13:41 +09:00
Masayuki Nakano 1affc933f7 Bug 1463985 - part 20: Rename EditSubAction::makeDefListItem to EditSubAction::eCreateOrChangeDefinitionList r=m_kato
MozReview-Commit-ID: 1ucTdFEjasz

--HG--
extra : rebase_source : 1c00f4b480ebc8c30ef5d6979319f6db01235dc9
2018-05-28 23:08:50 +09:00
Masayuki Nakano 220ec91e25 Bug 1463985 - part 19: Rename EditSubAction::removeList to EditSubAction::eRemoveList r=m_kato
MozReview-Commit-ID: DgsZwANcEdF

--HG--
extra : rebase_source : e0032e957ccc4448e210783a67ef83c1257c0a3b
2018-05-28 23:05:00 +09:00
Masayuki Nakano 7d6ea95d32 Bug 1463985 - part 18: Rename EditSubAction::makeBasicBlock to EditSubAction::eCreateOrRemoveBlock r=m_kato
MozReview-Commit-ID: 3GuscIcaWe9

--HG--
extra : rebase_source : 3f580a1d60296c232a70156d68a18a7b13c9d640
2018-05-28 23:01:19 +09:00
Masayuki Nakano 9a8bb4d35e Bug 1463985 - part 17: Rename EditSubAction::align to EditSubAction::eSetOrClearAlignment r=m_kato
MozReview-Commit-ID: KausJ4mihk9

--HG--
extra : rebase_source : 48fd37f2578714f46c0fcbf84788f9b0c69d3608
2018-05-28 22:51:31 +09:00
Masayuki Nakano b43f12de7f Bug 1463985 - part 16: Rename EditSubAction::indent and EditSubAction::outdent to EditSubAction::eIndent and EditSubAction::eOutdent r=m_kato
MozReview-Commit-ID: 2JDyYLT8V7Q

--HG--
extra : rebase_source : 5b0ebe706e8144fa6cbdf1ee16573d5166ef8028
2018-05-28 22:42:31 +09:00
Masayuki Nakano 004c690a96 Bug 1463985 - part 15: Rename EditSubAction::makeList to EditSubAction::eCreateOrChangeList r=m_kato
MozReview-Commit-ID: 4Mkh3Mfm6fY

--HG--
extra : rebase_source : 5509f3f2e05ce4fe25965ca69334309a9109a791
2018-05-28 22:36:19 +09:00
Masayuki Nakano 54321db367 Bug 1463985 - part 14: Rename EditSubAction::insertBreak to EditSubAction::eInsertParagraphSeparator r=m_kato
MozReview-Commit-ID: DhEzqhLxMme

--HG--
extra : rebase_source : 87e482478b881ba9c9fbc99562fce5e5a576e0ab
2018-05-28 22:27:47 +09:00
Masayuki Nakano f24da5be63 Bug 1463985 - part 13: Rename EditSubAction::setText to EditSubAction::eSetText r=m_kato
MozReview-Commit-ID: A4DF3fX9IV6

--HG--
extra : rebase_source : d89acbacb9f17a599ee5b1c1387fd08f42cac3b6
2018-05-28 22:20:43 +09:00
Masayuki Nakano b539d189c1 Bug 1463985 - part 12: Rename EditSubAction::outputText to EditSubAction::eComputeTextToOutput r=m_kato
MozReview-Commit-ID: ItJi2rKv6Pw

--HG--
extra : rebase_source : 3c0bea9a8cdfd74b3f65d504d32d63746afe82cd
2018-05-28 22:09:55 +09:00
Masayuki Nakano 9fa1c953b2 Bug 1463985 - part 11: Rename EditSubAction::setTextProperty and EditSubAction::removeTextProperty to EditSubAction::eSetTextProperty and EditSubAction::eRemoveTextProperty r=m_kato
There may be better name for them though.

MozReview-Commit-ID: KxwziJArh84

--HG--
extra : rebase_source : 3af1c052c62f244bbbeaef65ff3b203d35d88ef4
2018-05-28 22:05:10 +09:00
Masayuki Nakano cbdd1207ab Bug 1463985 - part 10: Rename EditSubAction::deleteSelection to EditSubAction::eDeleteSelectedContent r=m_kato
MozReview-Commit-ID: 8LNY42KnyDf

--HG--
extra : rebase_source : 7778c0ff7c3da1c5070d0e5acf607665ff8efd4f
2018-05-28 21:49:56 +09:00
Masayuki Nakano 99a921d037 Bug 1463985 - part 9: Rename EditSubAction::insertIMEText to EditSubAction::eInsertTextComingFromIME r=m_kato
MozReview-Commit-ID: 1TmryMStB7H

--HG--
extra : rebase_source : 33dea12fe1ce0d5b9ea9ee13681949f288056d2a
2018-05-28 21:44:39 +09:00
Masayuki Nakano 63f1437458 Bug 1463985 - part 8: Rename EditSubAction::insertText to EditSubAction::eInsertText r=m_kato
MozReview-Commit-ID: Bd7GMng3T1T

--HG--
extra : rebase_source : a7e1774282c69b38add45faa993682d98e976d6b
2018-05-28 21:36:47 +09:00
Masayuki Nakano 204a55a114 Bug 1463985 - part 7: Rename EditSubAction::eDeleteText to EditSubAction::deleteText r=m_kato
And the odd number assign does not make sense anymore.  So, removes it.

MozReview-Commit-ID: JSyMNcrNhpP

--HG--
extra : rebase_source : efdb31d94d0fcae50cd72b5ee0d27041a454887a
2018-05-28 21:29:14 +09:00
Masayuki Nakano 52bba9f895 Bug 1463985 - part 6: Rename EditSubAction::splitNode and EditSubAction::joinNode to EditSubAction::eSplitNode and EditSubAction::eJoinNodes r=m_kato
MozReview-Commit-ID: Lk0UKyzWK8d

--HG--
extra : rebase_source : 3bc062c85da2ca8d7e9f9ca072c478135b3850fc
2018-05-28 21:25:20 +09:00
Masayuki Nakano db6dc253e0 Bug 1463985 - part 5: Rename EditSubAction::deleteNode to EditSubAction::eDeleteNode r=m_kato
MozReview-Commit-ID: 1K5bdzvNUaF

--HG--
extra : rebase_source : a7347e953cfe8f4419f9982794a4d693af303220
2018-05-28 21:19:34 +09:00
Masayuki Nakano 32dc755297 Bug 1463985 - part 4: Rename EditSubAction::insertNode and EditSubAction::createNode to EditSubAction::eInsertNode and EditSubAction::eCreateNode r=m_kato
Although, there might be no reason to have those edit sub-actions separately.

MozReview-Commit-ID: BaaNCqfk4V4

--HG--
extra : rebase_source : 061bc85c85489b6b2617e05bd91254667ddedb1a
2018-05-28 21:16:44 +09:00
Masayuki Nakano 5de95ff37e Bug 1463985 - part 3: Rename EditSubAction::undo and EditSubAction::redo to EditSubAction::eUndo and EditSubAction::eRedo r=m_kato
MozReview-Commit-ID: 3eNlmFimFlu

--HG--
extra : rebase_source : 3ed271141f5161ca48cd39882fa6290b1d45946c
2018-05-28 20:36:06 +09:00
Masayuki Nakano 82c12dc72d Bug 1463985 - part 2: Rename EditSubAction::none to EditSubAction::eNone r=m_kato
MozReview-Commit-ID: 4wJyaNS1P1y

--HG--
extra : rebase_source : 169e2faffa25ed42875c8dccb5c49ae5aaa54ebb
2018-05-28 20:29:34 +09:00
Masayuki Nakano 99341a9445 Bug 1463985 - part 1: Rename EditAction to EditSubAction and related stuff r=m_kato
When we implement InputEvent.inputType, we need to set a stack class to record
which edit action is currently handled.  However, currently, we call smaller
jobs as edit action.  For example, when user types a character at selecting
some characters, then, EditAction::deleteSelection is performed first, then,
EditAction::insertText is performed.  However, for the InputEvent.inputType,
we need inserText information.  So, for making new enum EditAction, we need
to rename current EditAction to EditSubAction.

And also this renames related stuff:

EditorBase::mIsInEditAction -> EditorBase::mIsInEditSubAction
EditorBase::IsInEditAction() -> EditorBase::IsInEditSubAction()
EditorBase::mAction -> EditorBase::mTopLevelEditSubAction
TextEditRules::mTheAction -> TextEditRules::mTopLevelEditSubAction
EditorBase::StartOperation() ->
  EditorBase::OnStartToHandleTopLevelEditSubAction()
EditorBase::EndOperation() ->
  EditorBase::OnEndHandlingTopLevelEditSubAction()
AutoRules -> AutoTopLevelEditSubActionNotifier
RulesInfo -> EditSubActionInfo

MozReview-Commit-ID: cvSkPUjFm1

--HG--
extra : rebase_source : baf527a3e353b7a8ebe9a46be2243b059c500234
2018-05-28 20:12:34 +09:00
Masayuki Nakano b2a3e52b16 Bug 1430021 - part 1: Move |RefPtr<TextEditRules> mRules| from TextEditor to EditorBase r=m_kato
For calling some methods of mRules from EditorBase, let's move mRules member
from TextEditor to EditorBase.

Unfortunately, TextEditRules.h depends on EditAction which is declared in
EditorBase.h and that caused unnecessary include hell of EditorBase.h.  So,
let's move it to an independent header file.

MozReview-Commit-ID: 5HiSZLP9WHH

--HG--
extra : rebase_source : 3e2c40385a6f3d6d1e03ef4e213434383bb37d5f
2018-01-12 19:01:04 +09:00