gecko-dev/editor/libeditor
Masayuki Nakano f3fb0d1af8 Bug 1569613 - Add surrogate pair handling API to nsTextFragment r=hsivonen
We check surrogate pair at specific index in `nsTextFragement` in a lot of
places.  This requires boundary check of the index so that it can cause
security issue and crash reason with simple mistake, and also it steals
your time to understand the code what it does especially when it's a
part of an `if` condition.

Therefore, this patch adds new API to `nsTextFragment` and makes the all
surrogate pair handlers of `nsTextFragument` use new API.

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

--HG--
extra : moz-landing-system : lando
2019-08-06 05:43:21 +00:00
..
crashtests Bug 1556799 - Remove manual NAC as soon as parent chain changes. r=masayuki 2019-06-06 01:48:10 +00:00
tests Bug 1565919 - Don't separate words by contextual-based character. r=Ehsan 2019-08-03 13:44:56 +00:00
ChangeAttributeTransaction.cpp
ChangeAttributeTransaction.h
ChangeStyleTransaction.cpp
ChangeStyleTransaction.h
CompositionTransaction.cpp Bug 1548389 - part 0: Wrap modifying text node in editor with particular methods r=m_kato 2019-07-22 03:53:29 +00:00
CompositionTransaction.h
CreateElementTransaction.cpp
CreateElementTransaction.h
CSSEditUtils.cpp Bug 1549925 - Mark all methods of nsIDocumentStateListener as can_run_script r=m_kato 2019-05-09 07:37:51 +00:00
CSSEditUtils.h Bug 1549925 - Mark all methods of nsIDocumentStateListener as can_run_script r=m_kato 2019-05-09 07:37:51 +00:00
DeleteNodeTransaction.cpp Bug 1548389 - part 1: Implement API to get/set unmask-range of password editor r=m_kato 2019-07-22 03:53:36 +00:00
DeleteNodeTransaction.h
DeleteRangeTransaction.cpp Bug 1548389 - part 0: Wrap modifying text node in editor with particular methods r=m_kato 2019-07-22 03:53:29 +00:00
DeleteRangeTransaction.h
DeleteTextTransaction.cpp Bug 1548389 - part 0: Wrap modifying text node in editor with particular methods r=m_kato 2019-07-22 03:53:29 +00:00
DeleteTextTransaction.h Bug 1548389 - part 0: Wrap modifying text node in editor with particular methods r=m_kato 2019-07-22 03:53:29 +00:00
EditAction.h Bug 1569902 - part 1: Stop using attribute to consider whether a <br> element is an editor bogus node or not r=m_kato,smaug 2019-08-02 05:44:40 +00:00
EditActionListener.h
EditAggregateTransaction.cpp
EditAggregateTransaction.h
EditorBase.cpp Bug 1569902 - part 4: Make TextEditor inserts padding <br> element for empty last line after setting flags to NS_PADDING_FOR_EMPTY_LAST_LINE r=m_kato 2019-08-02 05:46:41 +00:00
EditorBase.h Bug 1569902 - part 4: Make TextEditor inserts padding <br> element for empty last line after setting flags to NS_PADDING_FOR_EMPTY_LAST_LINE r=m_kato 2019-08-02 05:46:41 +00:00
EditorCommands.cpp Bug 1560032 - part 2: Make cut/copy in password field available r=m_kato,smaug 2019-07-29 06:21:42 +00:00
EditorCommands.h Bug 1529884 - part 6: Through subject principal at Document::ExecCommand() to constructor of EditorBase::AutoEditActionDataSetter r=smaug 2019-06-10 10:27:07 +00:00
EditorController.cpp Bug 1543966 - part 1: Make "editing commands" and "editor commands" singleton classes r=m_kato 2019-04-15 07:49:46 +00:00
EditorController.h Bug 1543966 - part 1: Make "editing commands" and "editor commands" singleton classes r=m_kato 2019-04-15 07:49:46 +00:00
EditorDOMPoint.h Bug 1444847 - part 2: Sort out basic API of nsRange for consistency with coming StaticRange r=smaug 2019-06-28 07:47:29 +00:00
EditorEventListener.cpp Bug 1565584: move nsIContentUtils::ContentIsDescendantOf to nsINode::IsInclusiveDescendantOf. r=smaug 2019-07-15 10:02:21 +02:00
EditorEventListener.h Bug 1539356 - Mark EditorBase::InsertNodeTransaction() as MOZ_CAN_RUN_SCRIPT r=m_kato 2019-03-30 11:55:29 +00:00
EditorUtils.cpp Bug 1560032 - part 2: Make cut/copy in password field available r=m_kato,smaug 2019-07-29 06:21:42 +00:00
EditorUtils.h Bug 1560032 - part 2: Make cut/copy in password field available r=m_kato,smaug 2019-07-29 06:21:42 +00:00
EditTransactionBase.cpp
EditTransactionBase.h
HTMLAbsPositionEditor.cpp Bug 1569902 - part 4: Make TextEditor inserts padding <br> element for empty last line after setting flags to NS_PADDING_FOR_EMPTY_LAST_LINE r=m_kato 2019-08-02 05:46:41 +00:00
HTMLAnonymousNodeEditor.cpp Bug 1556799 - Remove manual NAC as soon as parent chain changes. r=masayuki 2019-06-06 01:48:10 +00:00
HTMLEditor.cpp Bug 1571621 - Convert VarCache prefs in HTMLEditor.cpp to static prefs. r=masayuki 2019-08-06 08:49:32 +00:00
HTMLEditor.h Bug 1569902 - part 4: Make TextEditor inserts padding <br> element for empty last line after setting flags to NS_PADDING_FOR_EMPTY_LAST_LINE r=m_kato 2019-08-02 05:46:41 +00:00
HTMLEditorCommands.cpp Bug 1529884 - part 6: Through subject principal at Document::ExecCommand() to constructor of EditorBase::AutoEditActionDataSetter r=smaug 2019-06-10 10:27:07 +00:00
HTMLEditorController.cpp Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan 2019-05-25 17:46:15 +00:00
HTMLEditorController.h Bug 1543966 - part 2: Make "HTML editor commands" and "document state commands" singleton classes r=m_kato 2019-04-15 07:29:17 +00:00
HTMLEditorDataTransfer.cpp Bug 1396224 - Avoid cache for private clipboard data r=mstange 2019-07-02 21:45:10 +00:00
HTMLEditorDocumentCommands.cpp Bug 1529884 - part 6: Through subject principal at Document::ExecCommand() to constructor of EditorBase::AutoEditActionDataSetter r=smaug 2019-06-10 10:27:07 +00:00
HTMLEditorEventListener.cpp Bug 1539356 - Mark EditorBase::InsertNodeTransaction() as MOZ_CAN_RUN_SCRIPT r=m_kato 2019-03-30 11:55:29 +00:00
HTMLEditorEventListener.h Bug 1539356 - Mark EditorBase::InsertNodeTransaction() as MOZ_CAN_RUN_SCRIPT r=m_kato 2019-03-30 11:55:29 +00:00
HTMLEditorObjectResizer.cpp Bug 1549925 - Mark all methods of nsIDocumentStateListener as can_run_script r=m_kato 2019-05-09 07:37:51 +00:00
HTMLEditRules.cpp Bug 1569613 - Add surrogate pair handling API to nsTextFragment r=hsivonen 2019-08-06 05:43:21 +00:00
HTMLEditRules.h Bug 1569902 - part 2: Stop using attribute to consider whether a <br> element is a special node for empty last line or not r=m_kato,smaug 2019-08-02 05:45:18 +00:00
HTMLEditUtils.cpp Bug 1569902 - part 2: Stop using attribute to consider whether a <br> element is a special node for empty last line or not r=m_kato,smaug 2019-08-02 05:45:18 +00:00
HTMLEditUtils.h Bug 1539110 - Make HTMLEditor::RemoveStyleInside() and HTMLEditor::SplitStyleAbovePoint() check tag names with whitelist r=m_kato 2019-04-12 01:17:50 +00:00
HTMLInlineTableEditor.cpp Bug 1534561 - Make editor use PresShell directly rather than nsIPresShell r=m_kato 2019-03-15 05:01:10 +00:00
HTMLStyleEditor.cpp Bug 1529884 - part 6: Through subject principal at Document::ExecCommand() to constructor of EditorBase::AutoEditActionDataSetter r=smaug 2019-06-10 10:27:07 +00:00
HTMLTableEditor.cpp Bug 1562876: rename Selection::RemoveRange to Selection::RemoveRangeAndUnselectFramesAndNotifyListeners. r=smaug 2019-07-03 13:26:14 +02:00
HTMLURIRefObject.cpp
HTMLURIRefObject.h
InsertNodeTransaction.cpp Bug 1548389 - part 1: Implement API to get/set unmask-range of password editor r=m_kato 2019-07-22 03:53:36 +00:00
InsertNodeTransaction.h
InsertTextTransaction.cpp Bug 1548389 - part 0: Wrap modifying text node in editor with particular methods r=m_kato 2019-07-22 03:53:29 +00:00
InsertTextTransaction.h
InternetCiter.cpp
InternetCiter.h
JoinNodeTransaction.cpp Bug 1548389 - part 0: Wrap modifying text node in editor with particular methods r=m_kato 2019-07-22 03:53:29 +00:00
JoinNodeTransaction.h
ManualNAC.h Bug 1556799 - Remove manual NAC as soon as parent chain changes. r=masayuki 2019-06-06 01:48:10 +00:00
moz.build Bug 1546578 - part 1: Get rid of HTMLEditorCommands.h r=m_kato 2019-04-26 02:20:22 +00:00
nsIAbsorbingTransaction.h
PlaceholderTransaction.cpp
PlaceholderTransaction.h
SelectionState.cpp Bug 1562876: rename Selection::AddRange to Selection::AddRangeAndSelectFramesAndNotifyListeners. r=smaug 2019-07-03 13:26:13 +02:00
SelectionState.h Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan 2019-04-12 13:14:25 +00:00
SplitNodeTransaction.cpp Bug 1548389 - part 0: Wrap modifying text node in editor with particular methods r=m_kato 2019-07-22 03:53:29 +00:00
SplitNodeTransaction.h
TextEditor.cpp Bug 1569613 - Add surrogate pair handling API to nsTextFragment r=hsivonen 2019-08-06 05:43:21 +00:00
TextEditor.h Bug 1569902 - part 4: Make TextEditor inserts padding <br> element for empty last line after setting flags to NS_PADDING_FOR_EMPTY_LAST_LINE r=m_kato 2019-08-02 05:46:41 +00:00
TextEditorDataTransfer.cpp Bug 1558674 - Allow chrome privileged documents to enable/disable copy/paste. r=Ehsan,bgrins 2019-06-18 20:40:19 +00:00
TextEditRules.cpp Bug 1570861 - Editor should store text node in mCachedSelectionNode to pass previous selected node/offset to spell checker r=masayuki 2019-08-02 07:44:20 +00:00
TextEditRules.h Bug 1569902 - part 4: Make TextEditor inserts padding <br> element for empty last line after setting flags to NS_PADDING_FOR_EMPTY_LAST_LINE r=m_kato 2019-08-02 05:46:41 +00:00
TextEditRulesBidi.cpp Bug 1534561 - Make editor use PresShell directly rather than nsIPresShell r=m_kato 2019-03-15 05:01:10 +00:00
TextEditUtils.cpp Bug 1569902 - part 2: Stop using attribute to consider whether a <br> element is a special node for empty last line or not r=m_kato,smaug 2019-08-02 05:45:18 +00:00
TextEditUtils.h Bug 1569902 - part 2: Stop using attribute to consider whether a <br> element is a special node for empty last line or not r=m_kato,smaug 2019-08-02 05:45:18 +00:00
TypeInState.cpp
TypeInState.h
WSRunObject.cpp Bug 1569902 - part 4: Make TextEditor inserts padding <br> element for empty last line after setting flags to NS_PADDING_FOR_EMPTY_LAST_LINE r=m_kato 2019-08-02 05:46:41 +00:00
WSRunObject.h Bug 1547897 - Make WSRunObject stop scanning outside of editing host r=m_kato 2019-05-27 12:10:23 +00:00