mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 09:15:35 +00:00
c7249ef506
`WSRunScanner` scans around given point in `GetWSNodes()` at construction with using `HTMLEditUtils` methods and caches editable text nodes between `mStartReasonContent` and `mEndReasonContent`. However, it's used only by `GetNextCharPoint()` and `GetPreviousCharPoint()`, and they shouldn't be referred after changing the DOM tree. Therefore, we can scan it directly only when it needs to scan. The patch rewrites `GetNextCharPoint()` and `GetPreviousCharPoint()` without `mNodeArray` and removes `mNodeArray` from its member. This may increase the cost of scanning next/previous text node, but improves the scan performance when it does not treat so wide range and they are called with a point whose container is not a text node. This patch unexpectedly changes the behavior of them, that causes the fix of 2 failures in `insertlinebreak.html` and `insertparagraph.html`. According to debugger, previously GetNextCharPoint()` in `ScanNextVisibleNodeOrBlockBoundaryFrom()` called point at `<br>` element returned no next char, then, `ScanNextVisibleNodeOrBlockBoundaryFrom()` returned end point which is block boundary of `<listing>` element (it is legacy HTML2 element and treated as `<pre>` element internally). Therefore, the inserted `<br>` element was misunderstood as invisible `<br>` at end of a block and inserted another `<br>` element for making it visible. However, the redesigned one fixed this bug with searching correct text node. Therefore, I cannot keep the buggy behavior in the new designed methods. Depends on D75470 Differential Revision: https://phabricator.services.mozilla.com/D75471 |
||
---|---|---|
.. | ||
composer | ||
libeditor | ||
reftests | ||
spellchecker | ||
txmgr | ||
AsyncSpellCheckTestHelper.jsm | ||
moz.build | ||
nsIDocumentStateListener.idl | ||
nsIEditActionListener.idl | ||
nsIEditor.idl | ||
nsIEditorMailSupport.idl | ||
nsIEditorObserver.idl | ||
nsIEditorSpellCheck.idl | ||
nsIHTMLAbsPosEditor.idl | ||
nsIHTMLEditor.idl | ||
nsIHTMLInlineTableEditor.idl | ||
nsIHTMLObjectResizer.idl | ||
nsITableEditor.idl |