mediawiki-extensions-Visual.../modules/ve/dm
Catrope 54a232a92b Allow nodes to handle their own children
For data->DOM, this is easy: .toDataElements() can optionally return an
array instead of an object, and that will be treated as the data to
insert. If this happens, the converter won't descend. The node handler
can recursively invoke the converter if it needs to (although I suspect
the current implementation is broken when converting block content in an
inline context).

For DOM->data, this is a bit more complex. The node sets
.static.handlesOwnChildren = true; , which triggers the converter to
pass a data slice rather than a single data element, and not to
descend. The node handler can invoke the converter to recursively
convert DOM subtrees to data.

ve.dm.Converter (data->DOM):
* Renamed createDataElement() to createDataElements()
** .toDataElement() may return element or array, handle this
* Renamed childDataElement to childDataElements, is now an array
* Actually alienate if .toDataElement() returns null
** Shockingly, this claimed to be supported before but wasn't
* Rather than pushing to data, concat to it
** Add closing if needed
* Don't descend if .toDataElement() returned an array of length >1, or
  if the node has .handlesOwnChildren = true

ve.dm.Converter (DOM->data):
* Split getDomSubtreeFromData() and getDomFromData()
* When converting a node that handles its own children, pass in a data
  slice and skip over that data

Change-Id: I196cb4c0895cbf0b428a189adb61b56565573ab3
2013-04-11 22:41:18 +00:00
..
annotations Actually use the doc parameter in toDomElements() 2013-04-09 23:48:03 +00:00
lineardata Merge "Implement next/prevBreakOffset and word skipping" 2013-04-09 22:24:41 +00:00
metaitems Fixes to DM metaList stuff under Roan's guidance. 2013-04-11 14:49:17 -07:00
nodes Pass the converter object to the node handler in toDataElement() 2013-04-11 11:12:44 -07:00
ve.dm.Annotation.js Actually use the doc parameter in toDomElements() 2013-04-09 23:48:03 +00:00
ve.dm.AnnotationFactory.js Convert AnnotationFactory and MetaItemFactory to NamedClassFactories 2013-04-09 12:05:05 -07:00
ve.dm.AnnotationSet.js Store data in LinearData class with an index-value store for objects 2013-03-30 10:06:34 +00:00
ve.dm.BranchNode.js Fix documentation to place @emits in the correct place 2013-03-25 21:06:05 +00:00
ve.dm.Converter.js Allow nodes to handle their own children 2013-04-11 22:41:18 +00:00
ve.dm.DataString.js UnicodeJS library to implement Unicode standards 2013-03-27 17:44:22 +00:00
ve.dm.Document.js Store data in LinearData class with an index-value store for objects 2013-03-30 10:06:34 +00:00
ve.dm.DocumentSlice.js Bump copyright notice year range to -2013 over -2012 2013-02-19 15:37:34 -08:00
ve.dm.DocumentSynchronizer.js Bump copyright notice year range to -2013 over -2012 2013-02-19 15:37:34 -08:00
ve.dm.IndexValueStore.js Store data in LinearData class with an index-value store for objects 2013-03-30 10:06:34 +00:00
ve.dm.js Bump copyright notice year range to -2013 over -2012 2013-02-19 15:37:34 -08:00
ve.dm.LeafNode.js Store data in LinearData class with an index-value store for objects 2013-03-30 10:06:34 +00:00
ve.dm.LinearData.js Store data in LinearData class with an index-value store for objects 2013-03-30 10:06:34 +00:00
ve.dm.MetaItem.js Add ve.ce.View as a common base class for ce.Node and ce.Annotation 2013-04-09 12:05:05 -07:00
ve.dm.MetaItemFactory.js Convert AnnotationFactory and MetaItemFactory to NamedClassFactories 2013-04-09 12:05:05 -07:00
ve.dm.MetaList.js Fixes to DM metaList stuff under Roan's guidance. 2013-04-11 14:49:17 -07:00
ve.dm.Model.js Allow nodes to handle their own children 2013-04-11 22:41:18 +00:00
ve.dm.ModelRegistry.js Convert AnnotationFactory and MetaItemFactory to NamedClassFactories 2013-04-09 12:05:05 -07:00
ve.dm.Node.js Allow nodes to handle their own children 2013-04-11 22:41:18 +00:00
ve.dm.NodeFactory.js Allow nodes to handle their own children 2013-04-11 22:41:18 +00:00
ve.dm.Surface.js Fixes to DM metaList stuff under Roan's guidance. 2013-04-11 14:49:17 -07:00
ve.dm.SurfaceFragment.js Store data in LinearData class with an index-value store for objects 2013-03-30 10:06:34 +00:00
ve.dm.Transaction.js Store data in LinearData class with an index-value store for objects 2013-03-30 10:06:34 +00:00
ve.dm.TransactionProcessor.js Store data in LinearData class with an index-value store for objects 2013-03-30 10:06:34 +00:00