mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
d4cbc09db8
`Selection::Extend()` is too slow because: - it may create some `nsRange` instances. - it users `nsContentUtils::ComparePoints()` multiple times. Therefore, we can improve the performance if we can stop using it in some places. First, this patch creates `Selection::SetStartAndEnd()` and `Selection::SetStartAndEndInLimiter()` for internal use. They remove current ranges, reuse `nsRange` instance as far as possible and add new range which is set by their arguments. Then, this patch makes `Selection::SelectAllChildren()` stop using `Selection::Extend()`. At this time, this fixes a web-compat issue. `Selection::Expand()` cannot cross the selection limiter boundary when there is a limiter (e.g., when an editing host has focus). But we can now fix this with using the new internal API. Note that methods in editor shouldn't move selection to outside of active editing host. Therefore, this patch adds `Selection::SetStartAndEndInLimiter()` and `Selection::SetBaseAndExtentInLimiter()` for them. Differential Revision: https://phabricator.services.mozilla.com/D23459 --HG-- extra : moz-landing-system : lando |
||
---|---|---|
.. | ||
composer | ||
libeditor | ||
reftests | ||
spellchecker | ||
txmgr | ||
AsyncSpellCheckTestHelper.jsm | ||
moz.build | ||
nsIDocumentStateListener.idl | ||
nsIEditActionListener.idl | ||
nsIEditor.idl | ||
nsIEditorMailSupport.idl | ||
nsIEditorObserver.idl | ||
nsIEditorSpellCheck.idl | ||
nsIEditorStyleSheets.idl | ||
nsIHTMLAbsPosEditor.idl | ||
nsIHTMLEditor.idl | ||
nsIHTMLInlineTableEditor.idl | ||
nsIHTMLObjectResizer.idl | ||
nsIPlaintextEditor.idl | ||
nsITableEditor.idl | ||
nsIURIRefObject.idl |