gecko-dev/editor/libeditor
Masayuki Nakano a9d57dd8a8 Bug 1478564 - part 1: Optimize TextEditRules::HandleNewLines() r=m_kato
TextEditRules::HandleNewLines() is expensive since it may scan all of given
string twice and more.  On the other hand, in most cases, given string does
not contain \n, \r nor \r\n.

First, for avoid using nsTString::FindCharInSet(), HandleNewLine() should
receive string which never contains \r nor \r\n.  Then, it always can use
nsTSubstring::FindChar() instead.

Next, HandleNewLines() should do nothing if given string does not contain \n.

Finally, because of unused, this removes unnecessary HandleNewLines() argument
which can specify the way to handle new lines.

MozReview-Commit-ID: 8WSfxfkuFgN

--HG--
extra : rebase_source : 1c05721162a30288929d030c0a15fe83a50fe9d2
2018-07-24 17:46:12 +09:00
..
crashtests Bug 1467794 - Split TextEditor::DeleteSelectionAsAction() to itself and TextEditor::DeleteSelectionAsSubAction() r=m_kato 2018-06-29 20:16:50 +09:00
tests Bug 1478564 - part 0: Add automated tests for TextEditRules::HandleNewLines() r=m_kato 2018-07-26 22:27:47 +09:00
CSSEditUtils.cpp Bug 1467722: Don't return null for getComputedStyle when there's no pres shell. r=heycam 2018-06-19 11:47:16 +02:00
CSSEditUtils.h
ChangeAttributeTransaction.cpp
ChangeAttributeTransaction.h
ChangeStyleTransaction.cpp
ChangeStyleTransaction.h
CompositionTransaction.cpp
CompositionTransaction.h
CreateElementTransaction.cpp Bug 1463981 part 3. Remove nsIDOMNode usage in editor. r=masayuki 2018-05-24 13:18:34 -04:00
CreateElementTransaction.h
DeleteNodeTransaction.cpp
DeleteNodeTransaction.h
DeleteRangeTransaction.cpp
DeleteRangeTransaction.h
DeleteTextTransaction.cpp
DeleteTextTransaction.h
EditAction.h Bug 1463985 - part 27: Replace EditSubAction::ignore with EditSubAction::eReplaceHeadWithHTMLSource and EditSubAction::eCreateBogusNode r=m_kato 2018-05-29 00:06:24 +09:00
EditActionListener.h
EditAggregateTransaction.cpp
EditAggregateTransaction.h
EditTransactionBase.cpp
EditTransactionBase.h
EditorBase.cpp Bug 1467802 - part 3: Create EditorBase::GetDocumentCharsetInternal() for internal use of nsIEditor::GetDocumentCharacterSet() r=m_kato 2018-07-18 21:11:32 +09:00
EditorBase.h Bug 1467802 - part 3: Create EditorBase::GetDocumentCharsetInternal() for internal use of nsIEditor::GetDocumentCharacterSet() r=m_kato 2018-07-18 21:11:32 +09:00
EditorCommands.cpp Bug 1476897 - part 6: Move implementation of both TextEditor::PasteAsQuotation() and HTMLEditor::PasteAsQuotation() to new virtual methods r=m_kato 2018-07-23 16:34:03 +09:00
EditorCommands.h
EditorController.cpp
EditorController.h
EditorDOMPoint.h Bug 1465478: Introduce Element::FromNode. r=smaug 2018-05-31 02:46:10 +02:00
EditorEventListener.cpp Bug 1476897 - part 6: Move implementation of both TextEditor::PasteAsQuotation() and HTMLEditor::PasteAsQuotation() to new virtual methods r=m_kato 2018-07-23 16:34:03 +09:00
EditorEventListener.h
EditorUtils.cpp
EditorUtils.h Merge mozilla-inbound to mozilla-central. a=merge 2018-05-31 13:04:21 +03:00
EditorUtils.js
EditorUtils.manifest
HTMLAbsPositionEditor.cpp Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj 2018-06-01 10:45:27 +02:00
HTMLAnonymousNodeEditor.cpp Bug 1465060 - Part 1: Fix warnings for std::move() use r=froydnj 2018-06-01 17:59:07 +02:00
HTMLEditRules.cpp Bug 1478605 - HTMLEditRules::SplitMailCites() should check if split left node has a primary frame before accessing it r=jorgk+176914 2018-07-26 19:38:33 +09:00
HTMLEditRules.h Bug 1471115 - Remove unused methods in nsIHTMLEditor. r=masayuki 2018-06-26 04:29:36 +00:00
HTMLEditUtils.cpp Bug 1463981 part 3. Remove nsIDOMNode usage in editor. r=masayuki 2018-05-24 13:18:34 -04:00
HTMLEditUtils.h Bug 1463981 part 3. Remove nsIDOMNode usage in editor. r=masayuki 2018-05-24 13:18:34 -04:00
HTMLEditor.cpp Bug 1476897 - part 7: Drop nsIEditorMailSupport interface from TextEditor r=m_kato 2018-07-23 16:45:07 +09:00
HTMLEditor.h Bug 1476897 - part 7: Drop nsIEditorMailSupport interface from TextEditor r=m_kato 2018-07-23 16:45:07 +09:00
HTMLEditorCommands.cpp Bug 1450882 - part 4: Make C++ users of nsICommandParams use nsCommandParams directly r=Ehsan 2018-07-10 20:04:21 +09:00
HTMLEditorCommands.h Bug 1468708 - Part 6. Move HTMLEditorCommands and HTMLEditorController to libeditor. r=masayuki 2018-06-13 14:49:06 -07:00
HTMLEditorController.cpp Bug 1468708 - Part 6. Move HTMLEditorCommands and HTMLEditorController to libeditor. r=masayuki 2018-06-13 14:49:06 -07:00
HTMLEditorController.h Bug 1468708 - Part 6. Move HTMLEditorCommands and HTMLEditorController to libeditor. r=masayuki 2018-06-13 14:49:06 -07:00
HTMLEditorDataTransfer.cpp Bug 1476897 - part 6: Move implementation of both TextEditor::PasteAsQuotation() and HTMLEditor::PasteAsQuotation() to new virtual methods r=m_kato 2018-07-23 16:34:03 +09:00
HTMLEditorDocumentCommands.cpp Bug 1476294 - Make HTMLEditorDocumentCommands.cpp use non-virtual methods of nsCommandParams instead of virtual methods of nsICommandParams r=Ehsan 2018-07-18 00:30:05 +09:00
HTMLEditorEventListener.cpp
HTMLEditorEventListener.h
HTMLEditorObjectResizer.cpp Bug 1405897 - Move assertion before setting resizer attribute. r=masayuki 2018-06-29 04:47:21 +00:00
HTMLEditorObjectResizerUtils.h
HTMLInlineTableEditor.cpp Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj 2018-06-01 10:45:27 +02:00
HTMLStyleEditor.cpp Bug 1463985 - part 24: Rename EditSubAction::resetTextProperties to EditSubAction::eRemoveAllTextProperties r=m_kato 2018-05-28 23:40:45 +09:00
HTMLTableEditor.cpp Bug 1467794 - Split TextEditor::DeleteSelectionAsAction() to itself and TextEditor::DeleteSelectionAsSubAction() r=m_kato 2018-06-29 20:16:50 +09:00
HTMLURIRefObject.cpp Bug 1463981 part 2. Remove use of nsIDOMNode in editor xpidl. r=masayuki 2018-05-24 13:18:34 -04:00
HTMLURIRefObject.h Bug 1463981 part 2. Remove use of nsIDOMNode in editor xpidl. r=masayuki 2018-05-24 13:18:34 -04:00
InsertNodeTransaction.cpp Bug 1463981 part 3. Remove nsIDOMNode usage in editor. r=masayuki 2018-05-24 13:18:34 -04:00
InsertNodeTransaction.h
InsertTextTransaction.cpp
InsertTextTransaction.h
InternetCiter.cpp Bug 1264876 - Remove StripCites() from nsIEditorMailSupport r=m_kato 2018-07-19 16:55:31 +09:00
InternetCiter.h Bug 1264876 - Remove StripCites() from nsIEditorMailSupport r=m_kato 2018-07-19 16:55:31 +09:00
JoinNodeTransaction.cpp
JoinNodeTransaction.h
ManualNAC.h
PlaceholderTransaction.cpp Bug 1469769 - Part 6: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r=froydnj 2018-06-17 22:43:11 -07:00
PlaceholderTransaction.h Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj 2018-06-01 10:45:27 +02:00
SelectionState.cpp Bug 358033 - Part 1. Restore direction of Selection. r=masayuki 2018-07-23 02:44:42 +00:00
SelectionState.h Bug 358033 - Part 1. Restore direction of Selection. r=masayuki 2018-07-23 02:44:42 +00:00
SplitNodeTransaction.cpp Bug 1463981 part 3. Remove nsIDOMNode usage in editor. r=masayuki 2018-05-24 13:18:34 -04:00
SplitNodeTransaction.h
TextEditRules.cpp Bug 1478564 - part 1: Optimize TextEditRules::HandleNewLines() r=m_kato 2018-07-24 17:46:12 +09:00
TextEditRules.h Bug 1478564 - part 1: Optimize TextEditRules::HandleNewLines() r=m_kato 2018-07-24 17:46:12 +09:00
TextEditRulesBidi.cpp
TextEditUtils.cpp
TextEditUtils.h
TextEditor.cpp Bug 1478564 - part 1: Optimize TextEditRules::HandleNewLines() r=m_kato 2018-07-24 17:46:12 +09:00
TextEditor.h Bug 1476897 - part 7: Drop nsIEditorMailSupport interface from TextEditor r=m_kato 2018-07-23 16:45:07 +09:00
TextEditorDataTransfer.cpp Bug 1467794 - Split TextEditor::DeleteSelectionAsAction() to itself and TextEditor::DeleteSelectionAsSubAction() r=m_kato 2018-06-29 20:16:50 +09:00
TextEditorTest.cpp
TextEditorTest.h
TypeInState.cpp
TypeInState.h
WSRunObject.cpp Bug 1469769 - Part 6: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r=froydnj 2018-06-17 22:43:11 -07:00
WSRunObject.h
moz.build Bug 1470361: Remove nsIEditorStyleSheets.addStyleSheet / removeStyleSheet / replaceStyleSheet. r=m_kato 2018-06-25 10:46:38 +02:00
nsIAbsorbingTransaction.h