mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 18:39:52 +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 | ||
lineardata | ||
metaitems | ||
nodes | ||
ve.dm.Annotation.js | ||
ve.dm.AnnotationFactory.js | ||
ve.dm.AnnotationSet.js | ||
ve.dm.BranchNode.js | ||
ve.dm.Converter.js | ||
ve.dm.DataString.js | ||
ve.dm.Document.js | ||
ve.dm.DocumentSlice.js | ||
ve.dm.DocumentSynchronizer.js | ||
ve.dm.IndexValueStore.js | ||
ve.dm.InternalList.js | ||
ve.dm.js | ||
ve.dm.LeafNode.js | ||
ve.dm.LinearData.js | ||
ve.dm.MetaItem.js | ||
ve.dm.MetaItemFactory.js | ||
ve.dm.MetaList.js | ||
ve.dm.Model.js | ||
ve.dm.ModelRegistry.js | ||
ve.dm.Node.js | ||
ve.dm.NodeFactory.js | ||
ve.dm.Surface.js | ||
ve.dm.SurfaceFragment.js | ||
ve.dm.Transaction.js | ||
ve.dm.TransactionProcessor.js |