gecko-dev/editor/libeditor
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
..
crashtests Bug 1423767 - Splitting node might be orphan. r=masayuki 2018-05-16 16:54:20 +09:00
tests Bug 1387143 part 5. Remove JS use of nsISelectionPrivate. r=mats 2018-05-08 13:52:36 -04:00
ChangeAttributeTransaction.cpp Bug 1379891 - remove nsPIEditorTransaction interface, GetTxnDescription methods. r=m_kato,masayuki 2018-01-14 16:01:41 +01:00
ChangeAttributeTransaction.h Bug 1425412 - part 9: Create factory methods of ChangeAttributeTransaction and remove EditorBase::CreateTxnForSetAttribute() and EditorBase::CreateTxnForRemoveAttribute() r=m_kato 2017-12-18 17:07:52 +09:00
ChangeStyleTransaction.cpp Bug 1408301: Remove getPropertyCSSValue. r=bz 2018-05-12 11:23:47 +02:00
ChangeStyleTransaction.h Bug 1425412 - part 11: Create factory methods for ChangeStyleTransaction and remove CSSEditUtils::CreateCSSPropertyTxn() r=m_kato 2017-12-18 17:46:57 +09:00
CompositionTransaction.cpp Bug 1463287: Add QueryInterface helper macro for concrete class types. r=bz 2018-05-21 16:33:18 -07:00
CompositionTransaction.h Bug 1425412 - part 4: Create CompositionTransaction::Create() and remove EditorBase::CreateTxnForComposition() r=m_kato 2017-12-15 18:26:37 +09:00
CreateElementTransaction.cpp Bug 1447213 - Change editor methods which take |const EditorRawDOMPoint&| but called with EditorDOMPoint.AsRaw() to template methods r=m_kato 2018-03-20 14:05:47 +09:00
CreateElementTransaction.h Bug 1447213 - Change editor methods which take |const EditorRawDOMPoint&| but called with EditorDOMPoint.AsRaw() to template methods r=m_kato 2018-03-20 14:05:47 +09:00
CSSEditUtils.cpp Bug 1408301: Remove getPropertyCSSValue. r=bz 2018-05-12 11:23:47 +02:00
CSSEditUtils.h Bug 1408301: Remove getPropertyCSSValue. r=bz 2018-05-12 11:23:47 +02:00
DeleteNodeTransaction.cpp Bug 1379891 - remove nsPIEditorTransaction interface, GetTxnDescription methods. r=m_kato,masayuki 2018-01-14 16:01:41 +01:00
DeleteNodeTransaction.h Bug 1425412 - part 6: Create DeleteNodeTransaction::MaybeCreate() and remove EditorBaseTransaction::CreateTxnForDeleteNode() r=m_kato 2017-12-15 21:24:33 +09:00
DeleteRangeTransaction.cpp Bug 1454241: Remove nsINode::eDATA_NODE. r=bz 2018-04-20 03:58:00 +02:00
DeleteRangeTransaction.h Bug 1425412 - part 12: Create factory methods for DeleteRangeTransaction, EditAggregateTransaction and PlaceholderTransaction for consistency with the other transaction classes r=m_kato 2017-12-18 18:08:43 +09:00
DeleteTextTransaction.cpp Bug 1446533 part 7. Remove nsIDOMCharacterData::InsertData. r=mystor 2018-03-19 15:38:04 -04:00
DeleteTextTransaction.h Bug 1446533 part 2. Rename nsGenericDOMDataNode.{h,cpp} to CharacterData. r=mystor 2018-03-19 15:18:07 -04:00
EditAction.h Bug 1430021 - part 1: Move |RefPtr<TextEditRules> mRules| from TextEditor to EditorBase r=m_kato 2018-01-12 19:01:04 +09:00
EditActionListener.h
EditAggregateTransaction.cpp Bug 1379891 - remove nsPIEditorTransaction interface, GetTxnDescription methods. r=m_kato,masayuki 2018-01-14 16:01:41 +01:00
EditAggregateTransaction.h Bug 1425412 - part 12: Create factory methods for DeleteRangeTransaction, EditAggregateTransaction and PlaceholderTransaction for consistency with the other transaction classes r=m_kato 2017-12-18 18:08:43 +09:00
EditorBase.cpp Bug 1463330 - Move CanPasteTransferable and PreDestroy to out of nsIEditor. r=masayuki 2018-05-22 18:23:21 +09:00
EditorBase.h Bug 1463330 - Move CanPasteTransferable and PreDestroy to out of nsIEditor. r=masayuki 2018-05-22 18:23:21 +09:00
EditorCommands.cpp Bug 1463330 - Move CanPasteTransferable and PreDestroy to out of nsIEditor. r=masayuki 2018-05-22 18:23:21 +09:00
EditorCommands.h
EditorController.cpp
EditorController.h
EditorDOMPoint.h Bug 1454126 - HTMLEditor should adjust selection outside native anonymous subtree when it inserts something at selection r=m_kato 2018-04-17 17:01:57 +09:00
EditorEventListener.cpp Bug 1387143 part 22. Remove nsISelection isCollapsed/collapsed bits. r=mats 2018-05-08 13:52:39 -04:00
EditorEventListener.h Bug 1455052 part 6. Stop using nsIDOMEvent in editor code. r=masayuki 2018-04-20 12:53:17 -04:00
EditorUtils.cpp Bug 1451972 - Remove more nsIDOMDocument usages from editor. r=masayuki 2018-04-06 14:53:05 +09:00
EditorUtils.h 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 2018-05-11 15:52:24 +09:00
EditorUtils.js Bug 1456035: Part 4 - Convert callers of XPCOMUtils.generateQI to ChromeUtils.generateQI. r=mccr8 2018-04-22 20:55:06 -07:00
EditorUtils.manifest
EditTransactionBase.cpp Bug 1379891 - remove nsPIEditorTransaction interface, GetTxnDescription methods. r=m_kato,masayuki 2018-01-14 16:01:41 +01:00
EditTransactionBase.h Bug 1379891 - remove nsPIEditorTransaction interface, GetTxnDescription methods. r=m_kato,masayuki 2018-01-14 16:01:41 +01:00
HTMLAbsPositionEditor.cpp 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 2018-04-26 22:41:34 +09:00
HTMLAnonymousNodeEditor.cpp Merge mozilla-inbound to mozilla-central. a=merge 2018-05-16 00:54:22 +03:00
HTMLEditor.cpp Bug 1463330 - Move CanPasteTransferable and PreDestroy to out of nsIEditor. r=masayuki 2018-05-22 18:23:21 +09:00
HTMLEditor.h Bug 1463330 - Move CanPasteTransferable and PreDestroy to out of nsIEditor. r=masayuki 2018-05-22 18:23:21 +09:00
HTMLEditorDataTransfer.cpp Merge mozilla-inbound to mozilla-central. a=merge 2018-05-23 12:51:22 +03:00
HTMLEditorEventListener.cpp Bug 1387143 part 22. Remove nsISelection isCollapsed/collapsed bits. r=mats 2018-05-08 13:52:39 -04:00
HTMLEditorEventListener.h Bug 1446711 part 8. Get rid of nsIDOMMouseEvent. r=qdot 2018-03-20 00:16:07 -04:00
HTMLEditorObjectResizer.cpp Bug 1387143 part 29. Remove nsISelection. r=mats 2018-05-08 13:52:42 -04:00
HTMLEditorObjectResizerUtils.h Bug 1433345 - part 4: Make EditorBase derived from nsISelectionListener and notify its owning classes of selection change r=m_kato 2018-01-26 17:25:45 +09:00
HTMLEditRules.cpp Bug 1460509 - part 44: Make HTMLEditRules::GetNodesForOperation() and related methods return NS_ERROR_EDITOR_DESTROYED if they cause destroying the editor r=m_kato 2018-05-15 18:07:34 +09:00
HTMLEditRules.h Bug 1460509 - part 44: Make HTMLEditRules::GetNodesForOperation() and related methods return NS_ERROR_EDITOR_DESTROYED if they cause destroying the editor r=m_kato 2018-05-15 18:07:34 +09:00
HTMLEditUtils.cpp Bug 1457813 - Part 3: Remove NS_PRECONDITION definition. r=froydnj 2018-05-08 22:21:22 -07:00
HTMLEditUtils.h Bug 1449147 - Clean up more nsIDOMNode usages in editor. r=masayuki 2018-03-27 20:19:35 +09:00
HTMLInlineTableEditor.cpp Bug 1429903 part 4. Remove nsIDOMEventTarget. r=mccr8 2018-04-20 00:49:30 -04:00
HTMLStyleEditor.cpp Bug 1387143 part 22. Remove nsISelection isCollapsed/collapsed bits. r=mats 2018-05-08 13:52:39 -04:00
HTMLTableEditor.cpp Bug 1377980 part 1. Remove use of nsIDOMRange in xpidl. r=mcc8 2018-05-17 12:01:37 -04:00
HTMLURIRefObject.cpp Bug 1446861 - Remove more nsIDOMElement usages from editor. r=masayuki 2018-03-19 14:14:45 +09:00
HTMLURIRefObject.h Bug 1432186 part 2. Clean up the string handling in HTMLURIRefObject::GetNextURI. r=mccr8 2018-01-29 23:10:50 -05:00
InsertNodeTransaction.cpp Bug 1447213 - Change editor methods which take |const EditorRawDOMPoint&| but called with EditorDOMPoint.AsRaw() to template methods r=m_kato 2018-03-20 14:05:47 +09:00
InsertNodeTransaction.h Bug 1447213 - Change editor methods which take |const EditorRawDOMPoint&| but called with EditorDOMPoint.AsRaw() to template methods r=m_kato 2018-03-20 14:05:47 +09:00
InsertTextTransaction.cpp Bug 1463287: Add QueryInterface helper macro for concrete class types. r=bz 2018-05-21 16:33:18 -07:00
InsertTextTransaction.h Bug 1425412 - part 1: Create InsertTextTransaction::Create() and remove EditorBase::CreateTxnForInsertText() r=m_kato 2017-12-15 17:26:52 +09:00
InternetCiter.cpp Bug 1424898 - patch 2 - De-virtualize nsIWordBreaker and rename to mozilla::intl::WordBreaker. r=m_kato 2017-12-13 22:17:38 -06:00
InternetCiter.h
JoinNodeTransaction.cpp Bug 1451672 - part 6: Rename EditorBase::JoinNodesImpl() to EditorBase::DoJoinNodes() r=m_kato 2018-04-10 03:56:46 +09:00
JoinNodeTransaction.h Bug 1425412 - part 8: Create JoinNodeTransaction::MaybeCreate() and remove EditorBase::CreateTxnForJoinNode() r=m_kato 2017-12-15 21:53:08 +09:00
ManualNAC.h
moz.build Bug 1451972 - Remove more nsIDOMDocument usages from editor. r=masayuki 2018-04-06 14:53:05 +09:00
nsIAbsorbingTransaction.h
PlaceholderTransaction.cpp Bug 1379891 - remove nsPIEditorTransaction interface, GetTxnDescription methods. r=m_kato,masayuki 2018-01-14 16:01:41 +01:00
PlaceholderTransaction.h Bug 1449147 - Clean up more nsIDOMNode usages in editor. r=masayuki 2018-03-27 20:19:35 +09:00
SelectionState.cpp Backed out 4 changesets (bug 525063) on request from Andi. a=backout 2018-04-13 16:01:28 +03:00
SelectionState.h Bug 1451672 - part 16: Rename EditorBase::MoveNode() to EditorBase::MoveNodeWithTransaction() and create EditorBase::MoveNodeToEndWithTransaction() r=m_kato 2018-04-12 23:58:52 +09:00
SplitNodeTransaction.cpp Bug 1451672 - part 6: Rename EditorBase::JoinNodesImpl() to EditorBase::DoJoinNodes() r=m_kato 2018-04-10 03:56:46 +09:00
SplitNodeTransaction.h Bug 1447213 - Change editor methods which take |const EditorRawDOMPoint&| but called with EditorDOMPoint.AsRaw() to template methods r=m_kato 2018-03-20 14:05:47 +09:00
StyleSheetTransactions.cpp Bug 1459529: Remove UPDATE_STYLE. r=heycam 2018-05-15 18:44:29 +02:00
StyleSheetTransactions.h Bug 1425412 - part 10: Create factory methods for AddStyleSheetTransaction and RemoveStyleSheetTransaction, and remove EditorBase::CreateTxnForAddStyleSheet() and EditorBase::CreateTxnForRemoveStyleSheet() r=m_kato 2017-12-18 17:29:32 +09:00
TextEditor.cpp Bug 1463399 - Remove unused local variable in TextEditor::OutputToString. r=masayuki 2018-05-22 21:07:09 +09:00
TextEditor.h Bug 1463330 - Move CanPasteTransferable and PreDestroy to out of nsIEditor. r=masayuki 2018-05-22 18:23:21 +09:00
TextEditorDataTransfer.cpp Bug 1463330 - Move CanPasteTransferable and PreDestroy to out of nsIEditor. r=masayuki 2018-05-22 18:23:21 +09:00
TextEditorTest.cpp Bug 1387143 part 3. Stop using nsISelection in nsISelectionController. r=mats 2018-05-08 13:52:36 -04:00
TextEditorTest.h
TextEditRules.cpp Bug 1460509 - part 13: Make TextEditRules::WillInsert() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato 2018-05-11 19:06:07 +09:00
TextEditRules.h Bug 1460509 - part 13: Make TextEditRules::WillInsert() return NS_ERROR_EDITOR_DESTROYED if it causes destroying the editor r=m_kato 2018-05-11 19:06:07 +09:00
TextEditRulesBidi.cpp Bug 1457083 - part 6: Get rid of unnecessary Selection argument from all protected/private methods of TextEditRules and HTMLEditRules r=m_kato 2018-05-10 15:03:21 +09:00
TextEditUtils.cpp Bug 1449147 - Clean up more nsIDOMNode usages in editor. r=masayuki 2018-03-27 20:19:35 +09:00
TextEditUtils.h Bug 1449147 - Clean up more nsIDOMNode usages in editor. r=masayuki 2018-03-27 20:19:35 +09:00
TypeInState.cpp Bug 1387143 part 22. Remove nsISelection isCollapsed/collapsed bits. r=mats 2018-05-08 13:52:39 -04:00
TypeInState.h Bug 1445569 - part 4: Get rid of EditorBase::GetStartNodeAndOffset() and EditorBase::GetEndNodeAndOffset() r=m_kato 2018-03-15 21:25:41 +09:00
WSRunObject.cpp Bug 1451672 - part 19: Remove TextEditor::CreateBR() and rename TextEditor::CreateBRImpl() to TextEditor::InsertBrElementWithTransaction() r=m_kato 2018-04-16 19:21:29 +09:00
WSRunObject.h Bug 1451672 - part 13: Rename EditorBase::InsertTextImpl() and EditorBase::InsertTextIntoTextNodeImpl() to EditorBase::InsertTextWithTransaction() and EditorBase::InsertTextIntoTextNodeWithTransaction() r=m_kato 2018-04-12 17:58:14 +09:00