Commit Graph

5573 Commits

Author SHA1 Message Date
Miko Mynttinen
8d9dc85cd4 Bug 1465060 - Part 1: Fix warnings for std::move() use r=froydnj
MozReview-Commit-ID: HpdFXqQdIOO

--HG--
extra : rebase_source : 619d0e0ff63a2453c80f0c4d9beb906d43fa9b01
2018-06-01 17:59:07 +02:00
Boris Zbarsky
15b087c696 Bug 1465875 part 4. Eliminate random mentions of nsIDOMNSEditableElement. r=qdot 2018-06-01 22:35:23 -04:00
Boris Zbarsky
0cf65db1d3 Bug 1465875 part 2. Eliminate use of "instanceof nsIDOMNSEditablElement". r=qdot 2018-06-01 22:35:22 -04:00
Boris Zbarsky
c7f378d7ab Bug 1465875 part 1. Eliminate pointless QIs to nsIDOMNSEditableElement. r=qdot
We expose the relevant APIs on textarea and input elements anyway
(chromeonly).  The QIs will throw on a non-input or non-textarea element, but
none of these consumers expect that to happen.
2018-06-01 22:35:22 -04:00
Emilio Cobos Álvarez
fffb25b74f Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

  s/mozilla::Move/std::move/
  s/ Move(/ std::move(/
  s/(Move(/(std::move(/

Removing the 'using mozilla::Move;' lines.

And then with a few manual fixups, see the bug for the split series..

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Nazım Can Altınova
361380987c Bug 1464496 - Part 1: Merge ServoDeclarationBlock and DeclarationBlock r=emilio
MozReview-Commit-ID: By9fV70Oq0K

--HG--
extra : rebase_source : 837afe9c33b21d7db41ff19d3aaf6cf3e9eedbdf
2018-05-30 18:15:25 +02:00
Andreea Pavel
38bcf897f1 Merge mozilla-inbound to mozilla-central. a=merge 2018-05-31 13:04:21 +03:00
Emilio Cobos Álvarez
fe09ffd3af Bug 1465478: Introduce Element::FromNode. r=smaug
And use it in a couple places I noticed.

MozReview-Commit-ID: 8baSMrbdEbF
2018-05-31 02:46:10 +02: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
Boris Zbarsky
931b9e37ad Bug 1455676 part 10. Remove use of nsIDOMNode from remaining xpidl. r=qdot 2018-05-29 22:58:49 -04:00
Boris Zbarsky
c73f664888 Bug 1463981 part 3. Remove nsIDOMNode usage in editor. r=masayuki 2018-05-24 13:18:34 -04:00
Boris Zbarsky
0f8f7f6fba Bug 1463981 part 2. Remove use of nsIDOMNode in editor xpidl. r=masayuki 2018-05-24 13:18:34 -04:00
Masayuki Nakano
11ae2207cf Bug 1463327 - part 4: Add comments to explain which kind of methods should be public methods r=m_kato
MozReview-Commit-ID: 6l8ZiMWEYCI

--HG--
extra : rebase_source : 024625012c917b17710016b91db10bfbaace2134
2018-05-22 20:15:05 +09:00
Masayuki Nakano
d40825b1e4 Bug 1463327 - part 3: Change scope of some methods of HTMLEditor which won't be called by non-helper classes of editing to protected r=m_kato
HTMLEditor has 2 type of public methods.  One is rue-public methods.  I.e.,
they should be able to be called by anybody.  E.g., command handlers, event
listeners, or JS via nsIEditor interface.  The other is semi-public methods.
They are not called by the above examples but called by other classes which
are helper classes to handle edit actions.  E.g., TextEditRules, HTMLEditRules,
HTMLEditUtils, CSSEditUtils and Transaction classes.

When we will implement InputEvent.inputType, we need to create new stack
class and create its instance at every true-public methods to manage current
inputType (like TextEditRules::AutoSafeEditorData).  Therefore, it should not
happen that new code starts to call semi-public methods without the new
stack class instance.

For preventing this issue, we should make HTMLEditor have only the true-public
methods as public.  The other public methods should be protected and their
users should be friend classes.  Then, we can protect such method from external
classes.

Note that this patch just moves the methods without any changes in HTMLEditor.h
(except removes BlockTransformationType since it's unused and replaces
ResizingRequestID with new enum class ResizeAt since normal enum isn't hit by
searchfox.org).

MozReview-Commit-ID: 7PC8E8vD7w2

--HG--
extra : rebase_source : 13f51565f2b89ab816ba529af18ee88193a9c932
2018-05-22 18:28:50 +09:00
Masayuki Nakano
f615160008 Bug 1463327 - part 2: Change scope of some methods of TextEditor which won't be called by non-helper classes of editing to protected r=m_kato
TextEditor has 2 type of public methods.  One is true-public methods.  I.e.,
they should be able to be called by anybody.  E.g., command handlers, event
listeners, or JS via nsIEditor interface.  The other is semi-public methods.
 They are not called by the above examples but called by other classes which
are helper classes to handle edit actions.  E.g., TextEditRules, HTMLEditRules,
HTMLEditUtils, CSSEditUtils and Transaction classes.

When we will implement InputEvent.inputType, we need to create new stack
class and create its instance at every true-public methods to manage current
inputType (like TextEditRules::AutoSafeEditorData).  Therefore, it should not
happen that new code starts to call semi-public methods without the new
stack class instance.

For preventing this issue, we should make TextEditor have only the true-public
methods as public.  The other public methods should be protected and their
users should be friend classes.  Then, we can protect such method from external
classes.

Note that this patch just moves the methods without any changes in TextEditor.h.

MozReview-Commit-ID: Db3H6d1V8IU

--HG--
extra : rebase_source : d928a6bb378d02944c5a207de83211c33bb63613
2018-05-22 16:40:44 +09:00
Masayuki Nakano
40ab33fe29 Bug 1463327 - part 1: Change scope of some methods of EditorBase which won't be called by non-helper classes of editing to protected r=m_kato
EditorBase (and other editor classes) have 2 type of public methods.  One is
true-public methods.  I.e., they should be able to be called by anybody.
E.g., command handlers, event listeners, or JS via nsIEditor interface.
The other is semi-public methods.  They are not called by the above examples
but called by other classes which are helper classes to handle edit actions.
E.g., TextEditRules, HTMLEditRules, HTMLEditUtils, CSSEditUtils and Transaction
classes.

When we will implement InputEvent.inputType, we need to create new stack
class and create its instance at every true-public methods to manage current
inputType (like TextEditRules::AutoSafeEditorData).  Therefore, it should not
happen that new code starts to call semi-public methods without the new
stack class instance.

For preventing this issue, we should make EditorBase have only the true-public
methods as public.  The other public methods should be protected and their
users should be friend classes.  Then, we can protect such method from external
classes.

Note that this patch just moves the methods without any changes in EditorBase.h
(except removes GetName() since there is no body of this method and removes
IterDirection since it's unused).

MozReview-Commit-ID: HBseKLL6pxx

--HG--
extra : rebase_source : 2251ff659d831d01a6778d38f4e2714fcf2d6ef4
2018-05-22 16:08:43 +09:00
Masayuki Nakano
6099476d10 Bug 1460509 - part 84: Make HTMLEditRules::GetNodesFromPoint() use IgnoredErrorResult instead of ErrorResult r=m_kato
HTMLEditRules::GetNodesFromPoint() uses ErrorResult only for checking in
debug build.  So, it should use IgnoredErrorResult instead.

MozReview-Commit-ID: 5roQI03A0kF

--HG--
extra : rebase_source : 5f54dc18635653d214b22520f4747a00258d9d9b
2018-05-22 23:22:27 +09:00
Masayuki Nakano
ddb1f08834 Bug 1460509 - part 83: Make HTMLEditRules::InsertBRIfNeeded() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: Kuga8LvWfaM

--HG--
extra : rebase_source : 8e3e855268a5bddf069a8cfbb869eb64074188fb
2018-05-18 12:41:53 +09:00
Masayuki Nakano
ec1146f4c4 Bug 1460509 - part 82: Refine comments of TextEditRules.h and HTMLEditRules.h r=m_kato
This patch adds new rules of TextEditRules and HTMLEditRules about
NS_ERROR_EDITOR_DESTROYED.

Additionally, this patch moves some method explanation in each .cpp file to .h
file.

MozReview-Commit-ID: JqZFrWyrND8

--HG--
extra : rebase_source : d86385d9c26bb23adae1eca3b1be1a868c20e353
2018-05-18 12:38:32 +09:00
Masayuki Nakano
7bbdd6b2f2 Bug 1460509 - part 81: Make HTMLEditRules::WillDeleteSelection() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: IPN1GMQYGeY

--HG--
extra : rebase_source : 97bd6e6d9e925a66c2f9f4dfb2678bc4e33aed42
2018-05-18 00:43:52 +09:00
Masayuki Nakano
c7127dda7f Bug 1460509 - part 80: Make HTMLEditRules::DeleteNodeIfCollapsedText() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: C8ZNGlKJXlq

--HG--
extra : rebase_source : 17bd0b929b6339c2736514c28a354b21c45143b6
2018-05-18 00:31:20 +09:00
Masayuki Nakano
7e3a011a75 Bug 1460509 - part 79: Make HTMLEditRules::TryToJoinBlocksWithTransaction() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: BdoIrAYckNe

--HG--
extra : rebase_source : 182d41eb20fbc3e4088b3fcb76347154e0e88df6
2018-05-18 00:22:43 +09:00
Masayuki Nakano
17eab7beeb Bug 1460509 - part 78: Make HTMLEditRules::MoveBlock() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: 7RKXiYaH2l0

--HG--
extra : rebase_source : 8c30c66fbd9e20382aa0c26f868b9b5099c212da
2018-05-18 00:08:58 +09:00
Masayuki Nakano
c66a577ca5 Bug 1460509 - part 77: Make HTMLEditRules::MoveNodeSmart() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: D9mgBt2ftuz

--HG--
extra : rebase_source : 1286eddebb2f26ab22223825f13d82e0f6d051cb
2018-05-18 00:02:00 +09:00
Masayuki Nakano
2250135c6b Bug 1460509 - part 76: Mark HTMLEditRules::MoveContents() as MOZ_MUST_USE since it may return NS_ERROR_EDITOR_DESTROYED r=m_kato
MozReview-Commit-ID: gBAssBJfrF

--HG--
extra : rebase_source : 20b4dac757f1991c95d16885726b38d01c238a92
2018-05-17 23:52:47 +09:00
Masayuki Nakano
ddf4765c0a Bug 1460509 - part 75: Make HTMLEditRules::DeleteNonTableElements() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: 9SIBECF8s1R

--HG--
extra : rebase_source : 5087d948f1f7bb64c9f202976bc85719fa6ddab4
2018-05-17 23:46:00 +09:00
Masayuki Nakano
0f41ff01e6 Bug 1460509 - part 74: Make HTMLEditRules::DidDeleteSelection() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: E3LGBAbaw7N

--HG--
extra : rebase_source : 2075312aad4062341272f95df2f19975c1b3779b
2018-05-17 23:21:52 +09:00
Masayuki Nakano
1f5ce6791d Bug 1460509 - part 73: Make HTMLEditRules::WillMakeList() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: 6qTXENBW8tV

--HG--
extra : rebase_source : d4dcf5a10b2e9b735ee4a10fcc5faeefc3ab8c3c
2018-05-17 20:51:56 +09:00
Masayuki Nakano
a982f9c53c Bug 1460509 - part 72: Mark HTMLEditRules::WillRemoveList() as MOZ_MUST_USE since it may return NS_ERROR_EDITOR_DESTROYED r=m_kato
Additionally, it creates AutoSelectionRestorer.  So, this patch adds
CanHandleEditAction() check after its caller since even if it returns
NS_OK, the editor might have been gone.

MozReview-Commit-ID: BgIbpHFFPE1

--HG--
extra : rebase_source : 010befdb34f8269f6f7fc24d1ae13eba4575aa69
2018-05-17 20:27:53 +09:00
Masayuki Nakano
c14d405f26 Bug 1460509 - part 71: Mark HTMLEditRules::WillMakeDefListItem() as MOZ_MUST_USE since it may return NS_ERROR_EDITOR_DESTROYED r=m_kato
MozReview-Commit-ID: LrLmebLbwWm

--HG--
extra : rebase_source : 71c24de0975d74d5c843e9aa4074936ebbf166f2
2018-05-17 20:18:49 +09:00
Masayuki Nakano
f176f48d03 Bug 1460509 - part 70: Mark HTMLEditRules::WillMakeBasicBlock() as MOZ_MUST_USE since it may return NS_ERROR_EDITOR_DESTROYED r=m_kato
MozReview-Commit-ID: 6mfoqUWync8

--HG--
extra : rebase_source : 39e601c8acea5fbb340727e833147a4148eb23e1
2018-05-17 20:01:19 +09:00
Masayuki Nakano
bb332ddad7 Bug 1460509 - part 69: Make HTMLEditRules::MakeBasicBlock() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: Gfnai2runLs

--HG--
extra : rebase_source : c207efa5d39a1b24077f61e61c14e951b5d6870b
2018-05-17 19:56:41 +09:00
Masayuki Nakano
b0c954a103 Bug 1460509 - part 68: Mark HTMLEditRules::DidMakeBasicBlock() as MOZ_MUST_USE since it may return NS_ERROR_EDITOR_DESTROYED r=m_kato
MozReview-Commit-ID: 5ZxF0ArbnLU

--HG--
extra : rebase_source : 08b22aebdadbadaecbca446998b898e20f25726a
2018-05-17 19:05:26 +09:00
Masayuki Nakano
93cbe764ca Bug 1460509 - part 67: Mark HTMLEditRules::WillIndent() as MOZ_MUST_USE since it may return NS_ERROR_EDITOR_DESTROYED r=m_kato
MozReview-Commit-ID: 3lP4jp2nOQy

--HG--
extra : rebase_source : d59d4d56370266f454b498811cb82d346636e244
2018-05-17 18:34:00 +09:00
Masayuki Nakano
c46d6b402b Bug 1460509 - part 66: Make HTMLEditRules::WillCSSIndent() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: nnnC5VDpk8

--HG--
extra : rebase_source : e7086f18ef64883b384b1823f9f2145c80629967
2018-05-17 18:27:35 +09:00
Masayuki Nakano
ba826bb7b6 Bug 1460509 - part 65: Make HTMLEditRules::WillHTMLIndent() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: 2jZh8GtC7BA

--HG--
extra : rebase_source : e0fe459ce72d2123dde811445193508c81b27102
2018-05-17 18:14:01 +09:00
Masayuki Nakano
0829b9a5a2 Bug 1460509 - part 64: Make HTMLEditRules::WillOutdent() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
And this patch creates a new method, OutdentAroundSelection(), to check if
restoring Selection with AutoSelectionRestorer causes destroying the editor.
However, this does NOT change any logic in the new method except changing some
else-if blocks to if blocks with early-return style.

MozReview-Commit-ID: JMIo4kUOkwx

--HG--
extra : rebase_source : 0d628ebb866d7b63f8b78e6d701c27378a82dfb6
2018-05-17 17:57:09 +09:00
Masayuki Nakano
ea6085a0ab Bug 1460509 - part 63: Make HTMLEditRules::RemovePartOfBlock() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
And this patch renames it to SplitRangeOffFromBlockAndRemoveMiddleContainer()
for making the name explain what it does.

MozReview-Commit-ID: 546dnCeoGOV

--HG--
extra : rebase_source : 7f0762cfa377a07d28342a1092ad0a7ee70fa108
2018-05-17 17:13:04 +09:00
Masayuki Nakano
7abbb58773 Bug 1460509 - part 62: Make HTMLEditRules::OutdentPartOfBlock() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: 7IkBuQ6Tr3P

--HG--
extra : rebase_source : 603ff14905ccbd8242e6d6b1b6262e4e8fdda8d3
2018-05-17 16:53:18 +09:00
Masayuki Nakano
e0bed56f18 Bug 1460509 - part 61: Make HTMLEditRules::SplitBlock() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
And this patch renames it to SplitRangeOffFromBlock() for making the name
explain what it does since "split" is used as splitting to two nodes widely
in editor.

MozReview-Commit-ID: GrRu5sI4yrP

--HG--
extra : rebase_source : 3ec27bce3769af518d3f1c317559fd89d379c539
2018-05-17 16:28:52 +09:00
Masayuki Nakano
100d1a3de0 Bug 1460509 - part 60: Make HTMLEditRules::ConvertListType() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: 1xbR3f73NR1

--HG--
extra : rebase_source : 0a755c0fff5634513194c735dbb91061241abf9f
2018-05-17 14:28:47 +09:00
Masayuki Nakano
d24790beb0 Bug 1460509 - part 59: Make HTMLEditRules::CreateStyleForInsertText() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: GsBcGxfJhbb

--HG--
extra : rebase_source : 2be90309491187294d173c494b8da36257558cd0
2018-05-16 15:36:20 +09:00
Masayuki Nakano
72f5a20b04 Bug 1460509 - part 58: Make HTMLEditRules::WillAlign() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: L6rjqZABqsI

--HG--
extra : rebase_source : 068aa7391b6a7de21cb819bad8f62fe5053691b3
2018-05-16 15:23:52 +09:00
Masayuki Nakano
c97adaf670 Bug 1460509 - part 57: Mark HTMLEditRules::AlignInnerBlocks() as MOZ_MUST_USE since it may cause destroying the editor r=m_kato
MozReview-Commit-ID: 8hBJPn1shZu

--HG--
extra : rebase_source : 2df70cd07015fa0895a5d7540c1179107088a8e2
2018-05-16 14:54:33 +09:00
Masayuki Nakano
7fd1c21f25 Bug 1460509 - part 56: Make HTMLEditRules::AlignBlockContents() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: Jn4m4uTdLtW

--HG--
extra : rebase_source : dcaa6a6ebfb34965053680b12fbaa0236ac604a6
2018-05-16 14:45:34 +09:00
Masayuki Nakano
bfe1ba2a3d Bug 1460509 - part 55: Make HTMLEditRules::AfterEditInner() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: 2qdCWOdMseM

--HG--
extra : rebase_source : 1fe675fe0251abbbad4c86d743c08013eb89d7bb
2018-05-16 14:32:47 +09:00
Masayuki Nakano
fad6eb8411 Bug 1460509 - part 54: Make HTMLEditRules::WillInsert() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: Mhim8mp1aw

--HG--
extra : rebase_source : e96c75ab6ebbb8d3a18f4cc762ec71a2680534bc
2018-05-16 14:21:21 +09:00
Masayuki Nakano
b646b85754 Bug 1460509 - part 53: Make HTMLEditRules::WillInsertText() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: 22xxFFECNbi

--HG--
extra : rebase_source : 2dfe0cf975be32e729f7c22e97ff1a177cb9ab29
2018-05-16 14:05:10 +09:00
Masayuki Nakano
fc5224c601 Bug 1460509 - part 52: Make HTMLEditRules::LoadHTML() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: IKjTmm738Yg

--HG--
extra : rebase_source : 1c70229fa7db244ec9837474fc579da06f4d6fdb
2018-05-16 13:56:33 +09:00
Masayuki Nakano
f7c89adb71 Bug 1460509 - part 51: Make HTMLEditRules::WillInsertBreak() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: 2oTOmT4HSv7

--HG--
extra : rebase_source : 06d1a35ae77830e95952732b5a6882bd700df448
2018-05-16 13:49:56 +09:00
Masayuki Nakano
55c30fa4e2 Bug 1460509 - part 50: Make HTMLEditRules::InsertBRElement() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: 7C3iy7T04M9

--HG--
extra : rebase_source : fb0a1701a3a897017f357d360f6191c39d168e6d
2018-05-16 01:47:54 +09:00
Masayuki Nakano
cd8e95a56b Bug 1460509 - part 49: Make HTMLEditRules::SplitMailCites() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: 1Jy6bHAmtkT

--HG--
extra : rebase_source : 0d399f7bf088eda4abf36491a137d265cadd9e5d
2018-05-16 01:30:44 +09:00
Masayuki Nakano
24e8d0ebc1 Bug 1460509 - part 48: Make HTMLEditRules::CheckForEmptyBlock() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
Additionally, this patch renames it to MaybeDeleteTopMostEmptyAncestor() for
making its name explain what it does.

MozReview-Commit-ID: 1i7zeq9In2T

--HG--
extra : rebase_source : 8d9de9e6154038a993be636c3cedf950a6efd179
2018-05-16 00:10:11 +09:00
Masayuki Nakano
88e74d4d62 Bug 1460509 - part 47: Make HTMLEditRules::ExpandSelectionForDeletion() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: BdumFS7Rluv

--HG--
extra : rebase_source : cac8969335de207283cb818dc47b359554777753
2018-05-15 19:15:56 +09:00
Masayuki Nakano
1448107d77 Bug 1460509 - part 46: Make HTMLEditRules::NormalizeSelection() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: 5yf1ZJ5sQ1t

--HG--
extra : rebase_source : 7542fbae0bb5bae0ee545ff1af72a5a7ea47ff19
2018-05-15 18:59:27 +09:00
Masayuki Nakano
981ebf6352 Bug 1460509 - part 45: Test if HTMLEditRules::PromoteRange() won't get range in Selection r=m_kato
PromoteRange() related methods do not change Selection nor the DOM tree.
Therefore, they must be safe.  However, only PromoteRange() takes an nsRange
instance and modifies it.  If it's in Selection, that causes selectionchange
event.  Therefore, we should check if given range is in Selection with
MOZ_ASSERT().

MozReview-Commit-ID: AXkmHFB4P08

--HG--
extra : rebase_source : 539b39d0217a7dc06f76e70546096d30b2734c02
2018-05-15 18:39:27 +09:00
Masayuki Nakano
d388cab96a Bug 1460509 - part 44: Make HTMLEditRules::GetNodesForOperation() and related methods return NS_ERROR_EDITOR_DESTROYED if they cause destroying the editor r=m_kato
Despite of the name of GetNodesForOperation() and related methods, it changes
the DOM tree if their aTouchContent is TouchContent::yes (by default).
Therefore, they should return NS_ERROR_EDITOR_DESTROYED if they cause destroying
the editor and all callers should check the result.  Therefore, this patch mark
them as MOZ_MUST_USE.

Additionally, because of importance of aTouchContent, this patch makes the
arguments not optional.  This change must make other developers being careful
to use them.  (Although TouchContent does not feel dangerous.  We should rename
it to make its risk clearer.)

On the other hand, this patch removes aTouchContent from
GetParagraphFormatNodes() since it's always called with TouchContent::no.
Therefore, this method is always safe.

Although I tried to document those methods, but I have not understood them
completely yet.  Perhaps, we should redesign them in another bug both to
learn them and making them faster and simpler.

MozReview-Commit-ID: 4vknJGUdwEe

--HG--
extra : rebase_source : 486949005283548697e6eeb7175f6189a66defaa
2018-05-15 18:07:34 +09:00
Masayuki Nakano
278c709e0b Bug 1460509 - part 43: Make HTMLEditRules::BustUpInlinesAtRangeEndpoints() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: CSYCey8ugA8

--HG--
extra : rebase_source : ed2ace9e445f750b317ab984707c3c44b12bd72b
2018-05-15 17:21:08 +09:00
Masayuki Nakano
7e4a66f58c Bug 1460509 - part 42: Make HTMLEditRules::BustUpInlinesAtBRs() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: 5KGPE8mPqge

--HG--
extra : rebase_source : 9de693ba99508ebc5b5c235cbc2ed589676fc045
2018-05-15 17:04:28 +09:00
Masayuki Nakano
6ce0d49219 Bug 1460509 - part 41: Make HTMLEditRules::ReturnInHeader() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: r03QSPXsZ2

--HG--
extra : rebase_source : 76b3a2043c8ffaa44bf861cd9e32256bba545ec1
2018-05-15 16:36:53 +09:00
Masayuki Nakano
0e442165f7 Bug 1460509 - part 40: Make HTMLEditRules::ReturnInParagraph() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: cnR8uXTfno

--HG--
extra : rebase_source : 5fdca1b01b3b37fd997f8686a03ada6079410e96
2018-05-15 16:22:59 +09:00
Masayuki Nakano
6c48f47e99 Bug 1460509 - part 39: Make HTMLEditRules::SplitParagraph() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: 38hfUl88xXI

--HG--
extra : rebase_source : 7086a0f907487a74bc4656ec3f27fee99727af19
2018-05-15 16:15:35 +09:00
Masayuki Nakano
23b339760b Bug 1460509 - part 38: Make HTMLEditRules::ReturnInListItem() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: Jl0oiBCuYPb

--HG--
extra : rebase_source : 825ea4d5bf571752b77b80d759bfe4071f902b6e
2018-05-15 15:32:11 +09:00
Masayuki Nakano
2a52edcc52 Bug 1460509 - part 37: Make HTMLEditRules::MakeBlockquote() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: 3pUx52d6EYd

--HG--
extra : rebase_source : 160cfd6bcdd00572c4242ed8cd8721dbee43ba76
2018-05-15 15:09:13 +09:00
Masayuki Nakano
d7b703771c Bug 1460509 - part 36: Make HTMLEditRules::RemoveBlockStyle() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: KDfxeD9k0UN

--HG--
extra : rebase_source : 2ec8c6fb2b8803e56605ebdeee5aacce5cd323f9
2018-05-15 00:43:07 +09:00
Masayuki Nakano
6cb4ec14c0 Bug 1460509 - part 35: Make HTMLEditRules::ApplyBlockStyle() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: 1ddHNx7lF9P

--HG--
extra : rebase_source : 660c205f47473daade92145385d047d482ded72e
2018-05-15 00:08:46 +09:00
Masayuki Nakano
76e7240d35 Bug 1460509 - part 34: Make HTMLEditRules::MaybeSplitAncestorsForInsertWithTransaction() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: 7MqtKPNAOZ1

--HG--
extra : rebase_source : e66f057754082e0b28f14311462a84516c06cc37
2018-05-14 23:55:53 +09:00
Masayuki Nakano
a3320a815b Bug 1460509 - part 33: Make HTMLEditRules::JoinNearestEditableNodesWithTransaction() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
Unfortunately, we need to make it take out argument for returning new first
child point of right node.  If we can create JoinNodesResult which have
nsresult and EditorDOMPoint, we can avoid that, but EditorBase::JoinNodes()
does not want it.  So, even if we create such class, only 2 callers of the
methods are its users...

MozReview-Commit-ID: 1zwVZ0FriwN

--HG--
extra : rebase_source : 1f7867774f9a30bec78596b0282717435e7223c0
2018-05-14 23:51:23 +09:00
Masayuki Nakano
f82870c55b Bug 1460509 - part 32: Mark HTMLEditRules::CacheInlineStyles() as MOZ_MUST_USE since it may cause destroying the editor and returns NS_ERROR_EDITOR_DESTROYED in such case r=m_kato
MozReview-Commit-ID: FJHxJ1j02l1

--HG--
extra : rebase_source : e881022bc486e3a8446afff6e3014dad6a79d292
2018-05-14 23:24:40 +09:00
Masayuki Nakano
5c4be41f42 Bug 1460509 - part 31: Make HTMLEditRules::GetInlineStyles() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: 3Nk1gBttuwM

--HG--
extra : rebase_source : b9e0d63683407d9e5440157309cb61d213524223
2018-05-14 23:20:28 +09:00
Masayuki Nakano
d13545d1b1 Bug 1460509 - part 30: Make HTMLEditRules::ReapplyCachedStyles() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: HSv2els7Lys

--HG--
extra : rebase_source : 716cf33ab9ef344d4ba40400eda7379c6a2ff85e
2018-05-14 23:14:50 +09:00
Masayuki Nakano
deb2c6e032 Bug 1460509 - part 29: Make HTMLEditRules::AdjustSpecialBreaks() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
And this patch renames it to
InsertBRElementToEmptyListItemsAndTableCellsInChangedRange().

MozReview-Commit-ID: 1DGhcI93YAk

--HG--
extra : rebase_source : caa675a5b02c18e9ca57171294bdaf48e7563dc0
2018-05-14 22:56:06 +09:00
Masayuki Nakano
603b4cc93a Bug 1460509 - part 28: Make HTMLEditRules::AdjustWhitespace() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: 6dFP6BYDXMg

--HG--
extra : rebase_source : 1e16de2a3a1289a638cd4b157c5f099170fa831f
2018-05-14 22:42:08 +09:00
Masayuki Nakano
9490ca976d Bug 1460509 - part 27: Make HTMLEditRules::PinSelectionToNewBlock() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: GW0xI5BBxqU

--HG--
extra : rebase_source : 44ffab9c212c1210b0a8e8bf63254622fd883281
2018-05-14 22:37:33 +09:00
Masayuki Nakano
314c0524b5 Bug 1460509 - part 26: Make HTMLEditRules::AdjustSelection() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: JCEvhhxNBgg

--HG--
extra : rebase_source : 8c6972c8367ce0e44fdc1edcb2b18174e7da2930
2018-05-14 19:25:48 +09:00
Masayuki Nakano
4d9d37891e Bug 1460509 - part 25: Make HTMLEditRules::RemoveEmptyNodes() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
And this patch renames it to RemoveEmptyNodesInChangedRange().

MozReview-Commit-ID: Kr2xmUOH1ZZ

--HG--
extra : rebase_source : 59a0a70360c6e0d426c329f4be757c2c0eac96c4
2018-05-14 19:07:59 +09:00
Masayuki Nakano
5f681e9b5d Bug 1460509 - part 24: Make HTMLEditRules::PopListItem() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: 2655OlPmteT

--HG--
extra : rebase_source : 464469593c4ed9fc58f75191cab47a72314001a8
2018-05-14 18:18:24 +09:00
Masayuki Nakano
3608fb3fbd Bug 1460509 - part 23: Make HTMLEditRules::RemoveListStructure() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: JLfjjtQS6Ar

--HG--
extra : rebase_source : a62dcf9cfa48c7c361efd80f76af7032703205e2
2018-05-14 17:47:21 +09:00
Masayuki Nakano
cf3ad1d97a Bug 1460509 - part 22: Mark HTMLEditRules::InsertBRIfNeededInternal() and its wrappers as MOZ_MUST_USE r=m_kato
MozReview-Commit-ID: 4ueY3i1QFuD

--HG--
extra : rebase_source : adfa0f9e6ffbcde2f050703cd01e70ee4b05c5cc
2018-05-12 11:56:56 +09:00
Masayuki Nakano
8f32e9e8a5 Bug 1460509 - part 21: Make HTMLEditRules::RemoveAlignment() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: JV2vdZXoYIL

--HG--
extra : rebase_source : 959b56974c5d9229cb371e3791b645c7db54c3cf
2018-05-12 11:39:01 +09:00
Masayuki Nakano
5983a789e1 Bug 1460509 - part 20: Make HTMLEditRules::MakeSureElemStartsAndEndsOnCR() and HTMLEditRules::MakeSureElemStartsOrEndsOnCR() return NS_ERROR_EDITOR_DESTROYED if they cause destroying the editor r=m_kato
MozReview-Commit-ID: I8HcvO9IB7x

--HG--
extra : rebase_source : 6ca2e3a58b84a150504c73a17bda6cc825a10176
2018-05-12 11:25:23 +09:00
Masayuki Nakano
b591f81cf5 Bug 1460509 - part 19: Make HTMLEditRules::AlignBlock() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
Additionally, this patch renames its specific enum class from ContentsOnly
to ResetAlignOf for making its target clearer.

MozReview-Commit-ID: KD4ndAsMClN

--HG--
extra : rebase_source : 302598397cf32893c7db18a6a014d0db862cb8f6
2018-05-12 10:58:57 +09:00
Masayuki Nakano
d5d67de86f Bug 1460509 - part 18: Make HTMLEditRules::ChangeIndentation() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
Additionally, this patch renames it to ChangeMarginStart() for making its
job clearer and add two inline wrapper methods.

MozReview-Commit-ID: L2GfLKhT6sa

--HG--
extra : rebase_source : d1d293f742214048ce5dfbbb7ebd50b0cbeed881
2018-05-12 10:29:41 +09:00
Masayuki Nakano
dd74573897 Bug 1460509 - part 17: Make HTMLEditRules::WillAbsolutePosition() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the HTML editor r=m_kato
MozReview-Commit-ID: EGqb0hNpNnc

--HG--
extra : rebase_source : 97eeaca8b9386afe9ec320cd549d278955b69167
2018-05-11 20:25:01 +09:00
Masayuki Nakano
44d0e05143 Bug 1460509 - part 16: Make HTMLEditRules::DidAbsolutePosition() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: BBAvHn08og4

--HG--
extra : rebase_source : 5f4996be4be1813e382ec4180a583d5026dd7c63
2018-05-11 19:39:26 +09:00
Masayuki Nakano
8cb4cfda65 Bug 1460509 - part 15: Make HTMLEditRules::WillRemoveAbsolutePosition() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: DXzdtPQ01lo

--HG--
extra : rebase_source : 1fa36a1195aa7a6b5d891f83659af155b5bb16c0
2018-05-11 19:32:00 +09:00
Masayuki Nakano
531991202f Bug 1460509 - part 14: Make HTMLEditRules::WillRelativeChangeZIndex() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: 8HEqK3DAPO4

--HG--
extra : rebase_source : bd1e3223b25d72ab0ef7728361fd9a9c3b8b12ab
2018-05-11 19:24:35 +09:00
Masayuki Nakano
285bb617db Bug 1460509 - part 13: Make TextEditRules::WillInsert() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
This patch also makes aCancel of TextEditRules::WillInsert() optional since
a lot of callers need to ignore the result.

MozReview-Commit-ID: JrvycxMQ9Mm

--HG--
extra : rebase_source : 9ecdc0fd363d9da33c12409f2993da9c58553598
2018-05-11 19:06:07 +09:00
Masayuki Nakano
21be173075 Bug 1460509 - part 12: Make TextEditRules::WillInsertBreak() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: Ia5MJ465Hdf

--HG--
extra : rebase_source : 15daea3f4c4fe68e0c39e07fa7fdfca8b3ccaee5
2018-05-11 18:49:44 +09:00
Masayuki Nakano
29bc07945c Bug 1460509 - part 11: Make TextEditRules::CollapseSelectionToTrailingBRIfNeeded() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: 3ulGUfu1af1

--HG--
extra : rebase_source : 0828f72d3c847d2c989ee8496567293e637ea3f8
2018-05-11 18:40:47 +09:00
Masayuki Nakano
6f6c32762e Bug 1460509 - part 10: Make TextEditRules::WillInsertText() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: RT0Bi9TBwt

--HG--
extra : rebase_source : d3c9657649dbce9ab8f872db9748a2d66d876f15
2018-05-11 18:29:54 +09:00
Masayuki Nakano
d43e448993 Bug 1460509 - part 9: Make TextEditRules::WillSetText() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: 9ksPugTVVqh

--HG--
extra : rebase_source : 25089af1de8fc8429118e773df25ec2788cb75b9
2018-05-11 17:33:55 +09:00
Masayuki Nakano
04fbe5c6c1 Bug 1460509 - part 8: Make TextEditRules::WillDeleteSelection() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
This patch creates internal method for it as DeleteSelectionWithTransaction()
because it needs to create SelectionBatcher and destruction of it may cause
destroying the editor.  Therefore, unfortunately, all callers of
DeleteSelectionWithTransaction() needs to check CanHandleEditAction()
manually.  If we could use try-catch, we could make it safer, though.

MozReview-Commit-ID: 13enOQjEzNn

--HG--
extra : rebase_source : 5a902026bcc507fbf9f1949fdcf33a98aabd9a0b
2018-05-11 17:15:53 +09:00
Masayuki Nakano
b2219367ca Bug 1460509 - part 7: Make TextEditRules::DidDeleteSelection() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
And also this patch removes unnecessary arguments from the method.

MozReview-Commit-ID: UKscK4vFVX

--HG--
extra : rebase_source : 7f6b9405824a3f175f165a2d7d75a293108278f3
2018-05-11 16:48:29 +09:00
Masayuki Nakano
d6057a85d0 Bug 1460509 - part 6: Make TextEditRules::RemoveRedundantTrailingBR() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: HpFo0SiTBWJ

--HG--
extra : rebase_source : 531116b0621557293f026f214601848a60602331
2018-05-11 16:36:07 +09:00
Masayuki Nakano
849d638e49 Bug 1460509 - part 5: Make TextEditRules::CreateTrailingBRIfNeeded() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
MozReview-Commit-ID: CNTgECam862

--HG--
extra : rebase_source : 633d729868f9cb6a287c45f98497e45a08ef2c95
2018-05-11 16:31:53 +09:00
Masayuki Nakano
349bf14f6b Bug 1460509 - part 4: Make TextEditRules::CreateBogusNodeIfNeeded() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato
Note that HTMLEditRules::DocumentModifiedWorker() is a runnable method.
So, it cannot return nsresult.  Therefore, it just checks the result
only with NS_WARNING_ASSERTION().

MozReview-Commit-ID: KBSpv5H5KGU

--HG--
extra : rebase_source : b356ab04d0459214df9dbb3dbfb0e3eecc686348
2018-05-11 16:24:15 +09:00
Masayuki Nakano
2d5d9aed52 Bug 1460509 - part 3: Make TextEditRules::HideLastPWInput() return NS_ERROR_EDITOR_DESTROYED when it causes destroying the editor r=m_kato
And also this patch marks it as MOZ_MUST_USE.  All callers have to check if
the result is NS_ERROR_EDITOR_DESTROYED at least.

MozReview-Commit-ID: H4DfU1asPpe

--HG--
extra : rebase_source : c11cc00500aad44bd542147fb971e3cce4d634e2
2018-05-11 16:08:47 +09:00
Masayuki Nakano
b2f86bbbe1 Bug 1460509 - part 2: Make TextEditRules::CreateBR() and TextEditRules::CreateMozBR() return both new <br> element node and error code since if they cause destroying the editor, each caller needs NS_ERROR_EDITOR_DESTROYED result r=m_kato
First, this patch changes TextEditRules::CreateBRInternal() to a private method
for making any callers use CreateBR() or CreateMozBR() instead.

Then, this patch makes TextEditRules::CreateBRInternal() return both nsresult
and created <br> element with CreateElementResult class.

Finally, this patch makes all callers of them check if they don't return an
error code including NS_ERROR_EDITOR_DESTROYED.

MozReview-Commit-ID: 18OvPmbDVHK

--HG--
extra : rebase_source : 328a91146539763cec317105b92aa3ce5d4b8233
2018-05-11 15:52:24 +09:00
Masayuki Nakano
9ac857639c Bug 1460509 - part 1: Declare NS_ERROR_EDITOR_DESTROYED error code and add a check method to TextEditRules whether it can keep handling edit action at a moment r=m_kato
This patch defines NS_ERROR_EDITOR_DESTROYED error code as an editor module
specific error code.

And creates TextEditRules::CanHandleEditAction() to check if the instance
can keep handling edit action.

MozReview-Commit-ID: 4qECwNBO0yz

--HG--
extra : rebase_source : a925a9b6840d4d06e2792b9fe276e062288b0806
2018-04-24 15:23:01 +09:00
Dorel Luca
dc6d856805 Merge mozilla-inbound to mozilla-central. a=merge 2018-05-23 12:51:22 +03:00
Makoto Kato
cac4fa86ed Bug 1463399 - Remove unused local variable in TextEditor::OutputToString. r=masayuki
Now RulesInfo uses nsAString, but old comment is "XXX Struct should store
a nsAReadable*".  We can remove unnecessary local variable of nsString.

MozReview-Commit-ID: C7gnTG7xTjU

--HG--
extra : rebase_source : e141bbcefd75d90b836668f710350d4362d66c76
2018-05-22 21:07:09 +09:00
Makoto Kato
71b2579c1e Bug 1463330 - Move CanPasteTransferable and PreDestroy to out of nsIEditor. r=masayuki
CanPasteTransferable and PreDestroy aren't used from script (inc. comm-central
and bluegriffon), so we should move these to out of nsIEditor.

MozReview-Commit-ID: GRfBobAm2qi

--HG--
extra : rebase_source : 812792ff43da24bfd9cb99c4b3127e6acdc43ba1
2018-05-22 18:23:21 +09:00
Kris Maglione
8340513b0c Bug 1463287: Add QueryInterface helper macro for concrete class types. r=bz
Using concrete class types with static IIDs in QueryInterface methods is a
pretty common pattern which isn't supported by any existing helper macros.
That's lead to separate ad-hoc implementations, with varying degrees of
dodginess, being scattered around the tree.

This patch adds a helper macro with a canonical (and safe) implementation, and
updates existing ad-hoc users to use it.

MozReview-Commit-ID: HaTGF7MN5Cv

--HG--
extra : rebase_source : ace930129d85960d22bc3048ca3bb19bbbd4a63e
extra : histedit_source : 03a87f746d957789d41381e4e1bfcc4fd7eebaf2%2C9c5bae9feeeef7721105db67be0f83e0ded66bb7
2018-05-21 16:33:18 -07:00
Kris Maglione
8134b33e89 Bug 1462964: Remove obsolete nsIDOMBlob interface. r=bz
MozReview-Commit-ID: 2HIlaSrvfBe

--HG--
extra : rebase_source : 944a6244dbfe1f0a37dd34a041d1329624a86f93
extra : histedit_source : d7859be664fed00f8504e40969480d3af3d674e7%2C4456b502db338bd06823654306e47c2583101396
2018-05-21 17:32:44 -07:00
Masayuki Nakano
8a70ae9bca Bug 1457083 - part 7: Remove methods of TextEditRules and HTMLEditRules, which just return NS_OK r=m_kato
Some Did*() of TextEditRules and HTMLEditRules do nothing except returning
NS_OK.  Let's remove them since there is no reason to keep them.

MozReview-Commit-ID: Jcdh5rnm5Yc

--HG--
extra : rebase_source : 54aedd8187edfa244bc8fbe8f560fb6ee064e9cf
2018-05-10 16:04:06 +09:00
Masayuki Nakano
16e2394c6e Bug 1457083 - part 6: Get rid of unnecessary Selection argument from all protected/private methods of TextEditRules and HTMLEditRules r=m_kato
Now, each protected/private method of TextEditRules and HTMLEditRules can
retrieve Selection instance safely and quickly.  Therefore, their pointer or
reference of Selection arguments are not necessary.  Therefore, this patch
removes them.

MozReview-Commit-ID: 1SPmKXmd7kz

--HG--
extra : rebase_source : 32dfd2d5e8b0667318a5b3766a8a7d8594bba8e7
2018-05-10 15:03:21 +09:00
Masayuki Nakano
dd36848f80 Bug 1457083 - part 5: Make all users of Selection in TextEditRules and HTMLEditRules use TextEditRules::SelectionRef() r=m_kato
After this patch applies, most methods of TextEditRules and HTMLEditRules
don't need to take Selection as their arguments.  Therefore, next patch will
remove them.

MozReview-Commit-ID: 99r3ZkfG2In

--HG--
extra : rebase_source : 8666ded8f2e6954f2e3cf6bb1ba1cf3313f65e70
2018-05-08 17:30:05 +09:00
Masayuki Nakano
97763c2c92 Bug 1457083 - part 4: Replace mHTMLEditor in HTMLEditRules with HTMLEditorRef() r=m_kato
Although, this patch removes first check of mHTMLEditor in each method.  If
this causes some security issues, we should add now.  However, automated
tests don't indicate it.

Anyway, it should be fixed by bug 1454900 in same cycle.

MozReview-Commit-ID: 3LAtOQHyR5J

--HG--
extra : rebase_source : 48b78cb9477c6c47d23a864404ce95ca9edb8588
2018-04-27 01:42:22 +09:00
Masayuki Nakano
07772cd672 Bug 1457083 - part 3: Replace mTextEditor in TextEditRules with TextEditorRef() r=m_kato
This patch adds a debug methods to check if AutoSafeEditorData as expected and
inserting top of each method whose mTextEditor is replaced with TextEditorRef().

MozReview-Commit-ID: 8yjHsypLMRx

--HG--
extra : rebase_source : 0c07d18d102d6ffe6f4bc0cf50ad0dfca1f8bd4d
2018-04-27 00:09:10 +09:00
Masayuki Nakano
30e06e667e Bug 1457083 - part 2: Make all observer methods of HTMLEditRules create AutoSafeEditorData r=m_kato
Except HTMLEditRules::WillJoinNodes(), observer methods of HTMLEditRules
accesses mHTMLEditor.  Therefore, we need to make them create AutoSafeEditorData
instance in the stack.

Note that for reducing EditorBase::GetSelection() calls, this patch adds
Selection& argument to all of them.

MozReview-Commit-ID: 6mjuD2gZwVp

--HG--
extra : rebase_source : 56f16747a80927f0477b9b54f6088be719ed7b01
2018-04-26 23:27:50 +09:00
Masayuki Nakano
5f8ba21730 Bug 1457083 - part 1: Make public methods of TextEditUtils and HTMLEditUtils guarantee that the editor instance and selection instance won't be destroyed while it handles any edit actions r=m_kato
This patch creates a stack class in TextEditRules, its name is
AutoSafeEditorData and make all public methods (except editor observer methods)
which may change DOM tree, fire some DOM events or calling some XPCOM listeners
create its instance in the stack.  Then, it grabs associated editor instance
and its selection instance.

Next patch will make remaining public methods create AutoSafeEditorData.

MozReview-Commit-ID: 8oshdhL3ONQ

--HG--
extra : rebase_source : 591db71e45fe28ca93cbebd9bb7da8c16eae4466
2018-04-26 22:41:34 +09:00
Boris Zbarsky
a02a40bdb5 Bug 1462737. Make AsElement() not compile when called on Element or some subclass. r=mccr8
It's just noise if we already have an Element.
2018-05-18 23:37:56 -04:00
Boris Zbarsky
2e09ba1f75 Bug 1377980 part 2. Remove most C++ use of nsIDOMRange. r=mccr8 2018-05-17 12:01:38 -04:00
Boris Zbarsky
40d2bf9d7f Bug 1377980 part 1. Remove use of nsIDOMRange in xpidl. r=mcc8 2018-05-17 12:01:37 -04:00
Makoto Kato
bf208eff66 Bug 1423767 - Splitting node might be orphan. r=masayuki
SplitNodeDeepWithTransaction will split nodes until better point. But
this test case becomes that node is orphan into loop.  So I would like to
add more check whether parent is nothing.

MozReview-Commit-ID: EroSV4uVBVL

--HG--
extra : rebase_source : f594bdf7cd9efac7d10e6e05a8f87dadfc761295
2018-05-16 16:54:20 +09:00
Dorel Luca
0d2ff9e60d Merge mozilla-inbound to mozilla-central. a=merge 2018-05-16 00:54:22 +03:00
Emilio Cobos Álvarez
11794a944d Bug 1461701: Remove nsUpdateType and UPDATE_CONTENT_MODEL. r=smaug
MozReview-Commit-ID: 33iBMZqnkAc
2018-05-15 18:47:16 +02:00
Emilio Cobos Álvarez
cb56e2c9f3 Bug 1459529: Remove UPDATE_STYLE. r=heycam
Now that BeginUpdate is useless for the UPDATE_STYLE case, we don't need the
update mechanism at all. Just ensure that ApplicableStylesChanged is called on
the pres shell via the relevant RuleChanged, etc. notifications.

There's a big hidden gotcha here. nsIDocument::BeginUpdate does put a script
blocker on the stack for these updates. However it's not needed, since no script
can run during these notifications (only the stylesheet events we post for
devtools, but those use AsyncEventDispatcher and PostDOMEvents, so they don't
try to run immediately).

nsIDocument::BeginUpdate also does XBL binding attached queue stuff, but we
can't change bindings during these notifications anyway, so it also doesn't
matter.

MozReview-Commit-ID: HJvK6zQfloh
2018-05-15 18:44:29 +02:00
Emilio Cobos Álvarez
2054320f28 Bug 1459529: Make sheets be associated to a shadow root too potentially. r=bz
MozReview-Commit-ID: Cd8xJuLRY5w
2018-05-15 18:44:25 +02:00
Adrian Wielgosik
3a8ef6cf8a Bug 1460940 - Remove nsIDOMDocument uses in editor/. r=bz
MozReview-Commit-ID: 8doC9drkrG9

--HG--
extra : rebase_source : 24ac8ea960faff10b04ef0f419bc6dc7b6556452
2018-05-11 19:46:15 +02:00
Emilio Cobos Álvarez
5aab8db970 Bug 1408301: Remove getPropertyCSSValue. r=bz
It's been removed for a while on Nightly without any known regressions. This
gives us a full beta cycle of telemetry and two nightly cycles without the API
before shipping.

This only removes the API, followup work will replace serialization by Servo's,
and remove the remaining DOM interfaces.

MozReview-Commit-ID: 2m1taYg5xEr
2018-05-12 11:23:47 +02:00
Cosmin Sabou
a916fb7c3e Merge inbound to mozilla-central. a=merge 2018-05-09 20:27:38 +03:00
Chris Peterson
87ddcb8273 Bug 1457813 - Part 3: Remove NS_PRECONDITION definition. r=froydnj
--HG--
extra : rebase_source : 9bad9e57e2e0363fb315949ac73b869fac0b9a73
2018-05-08 22:21:22 -07:00
Boris Zbarsky
1fb03996f4 Bug 1387143 part 29. Remove nsISelection. r=mats 2018-05-08 13:52:42 -04:00
Boris Zbarsky
a44e6132ff Bug 1387143 part 28. Remove nsISelection::AsSelection(). r=mats 2018-05-08 13:52:42 -04:00
Boris Zbarsky
b47b72dae9 Bug 1387143 part 23. Remove nsISelection collapse* methods. r=mats 2018-05-08 13:52:41 -04:00
Boris Zbarsky
f992e7ed0d Bug 1387143 part 22. Remove nsISelection isCollapsed/collapsed bits. r=mats 2018-05-08 13:52:39 -04:00
Boris Zbarsky
a36e7f946e Bug 1387143 part 9. Remove nsISelectionPrivate::Get/SetAncestorLimiter. r=mats 2018-05-08 13:52:37 -04:00
Boris Zbarsky
2abc41a969 Bug 1387143 part 8. Remove nsISelectionPrivate::Get/SetInterlinePosition. r=mats 2018-05-08 13:52:37 -04:00
Boris Zbarsky
abdd178705 Bug 1387143 part 7. Move the TABLESELECTION_* constants from nsISelectionPrivate to a TableSelection enum. r=mats 2018-05-08 13:52:36 -04:00
Boris Zbarsky
c4c94974c4 Bug 1387143 part 5. Remove JS use of nsISelectionPrivate. r=mats 2018-05-08 13:52:36 -04:00
Boris Zbarsky
921ee1d522 Bug 1387143 part 4. Stop using nsISelection in remaining xpidl. r=mats 2018-05-08 13:52:36 -04:00
Boris Zbarsky
46cae9462a Bug 1387143 part 3. Stop using nsISelection in nsISelectionController. r=mats 2018-05-08 13:52:36 -04:00
Boris Zbarsky
b23f25078d Bug 1387143 part 1. Stop using nsISelection in nsISelectionListener. r=mats 2018-05-08 13:52:35 -04:00
Masayuki Nakano
92a4e5d234 Bug 1452538 - Add telemetry probes HTMLEditors which have shown Gecko build-in editing UIs and count of user interaction with them r=Ehsan
Gecko has some built-in UIs:
* to edit size of objects like <img>, <table> and absolute positioned elements.
* to edit position of absolute positioned elements.
* to add/remove table columns and rows.

Currently, those UIs are available in both designMode editor and contenteditable
editor only on Gecko.  I.e., the other browsers' users cannot modify as such
without web apps implement such function.  So, for compatibility with the
other browsers, we should hide those UIs by default.  On the other hand, if
this is too risky for backward compatibility, we should not do that.

So, before doing that, we should collect actual usage data of object resizers,
inline table editing UI, positioning UI of absolute positioned elements with
telemetry probes.

This patch adds 3 sets of probes for each UI.  One is percentage of showing
each UI in all instantiated HTMLEditor.  The other is number of user interaction
of each UI in HTMLEditors which has shown the UI.

This patch makes all new probes as "opt-out" because they are really important
data since used for deciding whether those UIs are necessary or unnecessary.

MozReview-Commit-ID: B9Y6GTiCPw6

--HG--
extra : rebase_source : 00e49f31712e24cb269ad3aa65c7d13b7cccb3a5
2018-04-09 17:31:23 +09:00
Dorel Luca
2b4e625186 Backed out changeset b57df5aa1534 (bug 1457813) for conflict after bug 833098 got backed out. CLOSED TREE 2018-05-08 14:49:35 +03:00
Chris Peterson
5a63a12794 Bug 1457813 - Part 3: Remove NS_PRECONDITION definition. r=froydnj
Use fatal MOZ_ASSERT or non-fatal NS_ASSERTION instead.

MozReview-Commit-ID: 1QAsgoWpXDn

--HG--
extra : source : 9ca972b6b3e7d3b576e20a0bf412df51d82aad9f
extra : intermediate-source : a909a9d7bc9a53095e963a4bea45f4fc4aa85b72
2018-04-27 21:42:24 -07:00
Chris Peterson
71422dcaa9 Bug 1457813 - Part 2: Replace non-asserting NS_PRECONDITIONs with MOZ_ASSERTs. r=froydnj
s/NS_PRECONDITION/MOZ_ASSERT/ and reindent

MozReview-Commit-ID: KuUsnVe2h8L

--HG--
extra : source : c14655ab3df2c9b1465dd8102b9d25683359a37b
2018-04-28 12:50:58 -07:00
Boris Zbarsky
323a9a7102 Bug 1457862. Don't forget cellParent until we're done using it in HTMLEditor::GetCellContext. r=masayuki 2018-04-30 21:30:44 -04:00
Makoto Kato
db7992dc59 Bug 1457431 - Devirtualize mozInlineSpellChecker::SpellCheckAfterEditorChange. r=masayuki
It is unnecessary to keep virtual method for
mozInlineSpellChecker::SpellCheckAfterEditorChange, so we should remove virtual
keyword.

MozReview-Commit-ID: 2ry5uhMTFVC

--HG--
extra : rebase_source : ba86bb7c4e47598f83e3869733a238a740cef6b2
2018-04-27 21:11:31 +09:00
Xidorn Quan
f2ba299166 Bug 1448759 part 1 - Make KTableEntry an independent type. r=heycam
MozReview-Commit-ID: oZfJAigThN

--HG--
extra : rebase_source : 6a0efbf40fed8c9eaba7bb3af74d281b536677c8
2018-04-29 21:17:26 +10:00
Kris Maglione
a259026c9d Bug 1456035: Part 4 - Convert callers of XPCOMUtils.generateQI to ChromeUtils.generateQI. r=mccr8
This also removes any redundant Ci.nsISupports elements in the interface
lists.

This was done using the following script:

acecb401b7/processors/chromeutils-generateQI.jsm

MozReview-Commit-ID: AIx10P8GpZY

--HG--
extra : rebase_source : a29c07530586dc18ba040f19215475ac20fcfb3b
2018-04-22 20:55:06 -07:00
Boris Zbarsky
ffa08d7425 Bug 1455674 part 9. Remove nsIDOMElement use from nsIFocusManager. r=qdot 2018-04-26 23:35:19 -04:00
Boris Zbarsky
9e59f290d1 Bug 1455674 part 7. Simplify HTMLEditor::GetFocusedNode. r=masayuki 2018-04-26 23:35:19 -04:00
Boris Zbarsky
42cb3dbf9d Bug 1455674 part 6. Mostly remove use of nsIDOMElement in editor. r=masayuki 2018-04-26 23:35:18 -04:00
Boris Zbarsky
0659ea615e Bug 1455674 part 5. Remove remaining IDL use of nsIDOMElement in editor. r=masayuki 2018-04-26 23:35:18 -04:00
Boris Zbarsky
550b06a56b Bug 1455674 part 4. Stop using nsIDOMElement in nsIHTMLEditor::GetElementOrParentByTagName. r=masayuki 2018-04-26 23:35:18 -04:00
Boris Zbarsky
2348052be1 Bug 1455674 part 3. Stop using nsIDOMElement in nsITableEditor. r=masayuki
The patch is a bit large because all these methods except
SswitchTableCellHeaderType call each other; doing it piecemeal would have
required introducing, then removing, a bunch of QIs.
2018-04-26 23:35:18 -04:00
Boris Zbarsky
aab9f97f4e Bug 1455674 part 2. Mostly stop using nsIDOMElement in nsIHTMLEditor. r=masayuki
MozReview-Commit-ID: Koxv2qS2gft
2018-04-26 23:35:18 -04:00
Boris Zbarsky
c9bcb72283 Bug 1455674 part 1. Stop using nsIDOMElement in nsIEditor. r=masayuki 2018-04-26 23:35:18 -04:00
Boris Zbarsky
dd4506eee2 Bug 1457155. Rename various focus manager variables to make it clearer that they're Elements. r=mccr8 2018-04-26 15:28:31 -04:00
shindli
af700315a1 Backed out 2 changesets (bug 1457155, bug 1457156) for B failures in builds/worker/workspace/build/src/dom/html/HTMLObjectElement.cpp on a CLOSED TREE
Backed out changeset 8b2a6b54336c (bug 1457155)
Backed out changeset 4e267d999797 (bug 1457156)
2018-04-27 01:34:37 +03:00
Boris Zbarsky
25cec96459 Bug 1457155. Rename various focus manager variables to make it clearer that they're Elements. r=mccr8 2018-04-26 15:28:31 -04:00
Emilio Cobos Álvarez
081d926e7b Bug 1457026: Teach nsDocumentEncoder about display: contents. r=mats
MozReview-Commit-ID: 5F3qurRHMNM
2018-04-26 18:06:37 +02:00
Emilio Cobos Álvarez
a1b2e5070a Bug 1455885: Inline and make document casts fatally assert. r=bz
For consistency with AsElement / AsContent / AsDocumentFragment, etc.

MozReview-Commit-ID: 8GSj8R9hLBe
2018-04-26 17:05:12 +02:00
Emilio Cobos Álvarez
8239c1300e Bug 1386840: Defer loading and don't block rendering for non-matching stylesheets. r=bz,heycam
MozReview-Commit-ID: 24UJZDooGmn
2018-04-26 16:44:03 +02:00
Emilio Cobos Álvarez
5f526b4a81 Bug 1455559: Make FromNode work for references. r=bz,Nika
MozReview-Commit-ID: 1ldU1aKeMzs

--HG--
extra : rebase_source : 70a2537ab56d040f33acd84d4fd0c3d9de392198
2018-04-20 11:10:12 +02:00
Masayuki Nakano
552423e58f Bug 1456377 - Move composition event handlers from EditorBase to TextEditor r=m_kato
Currently, EditorBase handles most composition events.  However, only
eCompositionChange event handler is in TextEditor and it's the main event
of handling composition.  Therefore, we should make all composition event
handlers in one place for easier to read, and make them non-virtual.

MozReview-Commit-ID: BYDhiPyGKvo

--HG--
extra : rebase_source : ed9db0f49d7ae268c85359e48015e86584f9c999
2018-04-19 00:31:51 +09:00
Masayuki Nakano
f52e0b206b Bug 1455903 - Make EditorBase::CloneAttributesWithTransaction() set sourceElement to aSourceElement rather than aDestElement r=m_kato
This is simple mistake of bug 1451672.

EditorBase::CloneAttributesWithTransaction() sets both sourceElement and
destElement to aDestElement, but of course, it should set sourceElement to
aSourceElement.

Additionally, this patch adds mozilla specific web-platform tests to check
attribute cloning with basic edit operation.

MozReview-Commit-ID: GM1VjRHG7C3

--HG--
extra : rebase_source : 95427853442454525232df519ce5b5ad7bb12693
2018-04-23 18:02:50 +09:00
Makoto Kato
3f513220d0 Bug 1455533 - Part 3. Remove unused nsIEditor.outputToStream. r=masayuki
No one uses outputToStream even if c-c and BlueGriffon.  We should remove this.

MozReview-Commit-ID: LEUtfc89DBe

--HG--
extra : rebase_source : f0c5aa918f577ca8a285afd2414fe3da6545fefc
2018-04-20 16:41:07 +09:00
Makoto Kato
da20106275 Bug 1455533 - Part 2. Devirtualize EditorBase::PostCreate. r=masayuki
No one uses postCreate from script even if c-c and BlueGriffon. So we should
devirtualize this

MozReview-Commit-ID: D3FKVEvG7Go

--HG--
extra : rebase_source : 9915a93ea8ae18bee251507a4c94fe66c0f03d0f
2018-04-20 16:40:24 +09:00
Makoto Kato
bda5448bb6 Bug 1455533 - Part 1. Devirtualize EditorBase::SyncRealTimeSpell. r=masayuki
No one uses syncRealTimeSpell from script even if c-c and BlueGriffon. So
we should devirtualize this

MozReview-Commit-ID: AoOb165dOFa

--HG--
extra : rebase_source : e1a9dcdfa6cfe6c918a06a2738c38a6cb9441a1d
2018-04-20 16:27:16 +09:00
Masayuki Nakano
94dd5a92a4 Bug 1454126 - HTMLEditor should adjust selection outside native anonymous subtree when it inserts something at selection r=m_kato
HTMLEditor::InsertElementAtSelection() doesn't check if selection is in
native anonymous subtree.  Therefore, it could insert element into <input>
element etc.

This patch adds new API to EditorDOMPointBase to compute ancestor point which
is not in native-anonymous subtree and make
HTMLEditor::GetBetterInsertionPointFor() use it to not return point in any
native-anonymous subtrees.
2018-04-17 17:01:57 +09:00
Masayuki Nakano
f0d6418200 Bug 1451672 - part 24: Rename HTMLEditor::CopyLastEditableChildStyles() to HTMLEditor::CopyLastEditableChildStylesWithTransaction() r=m_kato
Like this adds new comments into the method, we should optimize the method
since it may create a lot of transactions and dispatch a lot of mutation
events.

MozReview-Commit-ID: FknJfu6QCjS

--HG--
extra : rebase_source : 39dc110b1101134f7c704e64dbff89171fe50e47
2018-04-17 01:15:23 +09:00
Masayuki Nakano
37e4fef8fd Bug 1451672 - part 23: Rename HTMLEditor::Set*BackgroundColor() to HTMLEditor::Set*BackgroundColorWithTransaction() r=m_kato
MozReview-Commit-ID: 7kUahOPZCwE

--HG--
extra : rebase_source : 18478bb1b4f4b91af7e2e6963523a76a69dbca24
2018-04-17 00:02:39 +09:00
Masayuki Nakano
cb6f42437a Bug 1451672 - part 22: Rename HTMLEditor::InsertNodeIntoProperAncestor() to HTMLEditor::InsertNodeIntoProperAncestorWithTransaction() r=m_kato
MozReview-Commit-ID: 6O47YeSpud8

--HG--
extra : rebase_source : 27dfc30cb50dbd0cc31493ed087ffae8744b3017
2018-04-16 23:53:46 +09:00
Masayuki Nakano
043e93a8ba Bug 1451672 - part 21: Refine TextEditor::TypedText() r=m_kato
According to existing comments, TextEditor::TypedText() and
HTMLEditor::TypedText() are intentional bottleneck to debug.  However, only
for that purpose, it and its internal methods are made virtual.  This really
doesn't make sense.

So, this patch creates TextEditor::OnInputText() for callers of TypedText()
with non-empty string, TextEditor::OnInputParagraphSeparator() for callers
of TypedText() with eTypeBreak (Enter key or insertParagraphSeparator),
HTMLEditor::OnInputLineBreak() for callers of TypedText() with eTypeBR
(Shift + Enter or insertLineBreak).  Additionally, this creates internal
non-virtual methods for XPCOM methods which are used as internal methods of
TypedText().  One is InsertTextAsAction() for nsIPlatintextEditor.insertText().
the other is InsertParagraphSeparator() for nsIPlaintextEditor.insertLineBreak().

Although those new methods are not have "WithTransaction" postfix, they must
be clearer they'll use transactions since user input and actions should be
undo-able.

MozReview-Commit-ID: AmOkMqovIKA

--HG--
extra : rebase_source : 9c0f4b25fa2a36ad2f3394f72eb290824c31d82a
2018-04-16 23:43:36 +09:00
Masayuki Nakano
c5bb2c4b29 Bug 1451672 - part 20: Rename HTMLEditor::MakeDefinitionItem() and HTMLEditor::InsertBasicBlock() with "WithTransaction" postfix r=m_kato
MozReview-Commit-ID: 2D50suUnFcw

--HG--
extra : rebase_source : 7ea3cfa390f6d8986be607faf6a4677b05b10a1d
2018-04-16 20:33:27 +09:00
Masayuki Nakano
a409fc4d17 Bug 1451672 - part 19: Remove TextEditor::CreateBR() and rename TextEditor::CreateBRImpl() to TextEditor::InsertBrElementWithTransaction() r=m_kato
TextEditor::CreateBR() is just a wrapper of TextEditor::CreateBRImpl() for
automatically retrieving Selection of the editor.

And TextEditor::CreateBRImpl() should be renamed to
TextEditor::InsertBrElementWithTransaction() for making it clearer what
it does.

MozReview-Commit-ID: D8sjVdLrVrd

--HG--
extra : rebase_source : f269f5c3ce598d221d7263c111475dab0dd5f19f
2018-04-16 19:21:29 +09:00
Masayuki Nakano
5af458988b Bug 1451672 - part 18: Rename EditorBase::CloneAttributes() to EditorBase::CloneAttributesWithTransaction() r=m_kato
MozReview-Commit-ID: 5tL31gRDVc9

--HG--
extra : rebase_source : dede345becde79dd9363f1df1980715713a80ef1
2018-04-13 18:44:08 +09:00
Masayuki Nakano
3da9675a5e Bug 1451672 - part 17: Rename EditorBase::InsertContainerAbove() to EditorBase::InsertContainerWithTransactionInternal() and wraps it with new inline methods, EditorBase::InsertContainerWithTransaction() r=m_kato
Similar to EditorBase::ReplaceContainerWithTransaction(),
EditorBase::InsertContainerAbove() may set an attribute to newly created element
if it's specified.  However, for avoiding the null check, let's make them
as references rather than pointers and treat nsGkAtoms::_empty as nullptr for
making the code safer.

This patch removes "Above" from the method name since it's redundant.
"Insert" sounds like inserting a node, and "Container" means to keep existing
children with new element in EditorBase.

MozReview-Commit-ID: 6EnkKHynYSP

--HG--
extra : rebase_source : d4b4c1a611c46a0f4d86389aab3331af565199d2
2018-04-13 18:17:04 +09:00
Masayuki Nakano
2d04b175d7 Bug 1451672 - part 16: Rename EditorBase::MoveNode() to EditorBase::MoveNodeWithTransaction() and create EditorBase::MoveNodeToEndWithTransaction() r=m_kato
This patch renames EditorBase::MoveNode() to
EditorBase::MoveNodeWithTransaction() and redesign its parameters including
replacing a set of container node and offset in it to EditorDOMPointBase.
However, it takes magic number -1 as meaning end of the container.
Therefore, this patch adds MoveNodeToEndWithTransaction() for keeping the
callers simple.

MozReview-Commit-ID: BeTq5c7GQNN

--HG--
extra : rebase_source : b3a617a5a1a493cb0fcbefe2d9a9708b0257b1a8
2018-04-12 23:58:52 +09:00
Masayuki Nakano
71964e6004 Bug 1451672 - part 15: Rename EditorBase::RemoveContainer() and HTMLEditor::RemoveBlockContainer() with "WithTransaction" postfix and make their argument |Element&| r=m_kato
MozReview-Commit-ID: 2toj48mqHM9

--HG--
extra : rebase_source : 621cb7a3137137dab45c311836b8304e7bd772f2
2018-04-12 22:23:04 +09:00