mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 14:56:20 +00:00
9372ca60ad
The way it operated was evil. It did a depth-first search from the root, finding the node using reference equality. For documents with deep structures, this could take a long time. Inez did some profiling and found it was called tens of millions of times on a complex document. Kill getOffsetFromNode() and move its functionality to getOffset(). The logic has been completely rewritten: getOffset() now traverses up from the node rather than down from the root, and pretty much does the reverse of what getNodeFromOffset() does. This should be much more efficient even without offset caching in the node objects (which we may still implement later). Change-Id: I125f9fa423c40db6472e2c4a7c94214218ba3bc7 |
||
---|---|---|
.. | ||
annotations | ||
nodes | ||
styles | ||
ve.ce.Annotation.js | ||
ve.ce.AnnotationFactory.js | ||
ve.ce.BranchNode.js | ||
ve.ce.ContentBranchNode.js | ||
ve.ce.Document.js | ||
ve.ce.DomRange.js | ||
ve.ce.FocusableNode.js | ||
ve.ce.js | ||
ve.ce.LeafNode.js | ||
ve.ce.Node.js | ||
ve.ce.NodeFactory.js | ||
ve.ce.ProtectedNode.js | ||
ve.ce.RelocatableNode.js | ||
ve.ce.ResizableNode.js | ||
ve.ce.Surface.js | ||
ve.ce.SurfaceObserver.js | ||
ve.ce.View.js |