https://de.wikipedia.org/w/index.php?title=Venus_von_Savignano&diff=prev&oldid=179042971&diffmode=visual&visualdiff=1 just shows a loading bar, and the error "jQuery.Deferred exception: listContents is undefined" in the console.
Description
Details
Related Objects
- Mentioned In
- T200006: Visual diffs of categories are confusing since categories aren't rendered
- Mentioned Here
- rGVEDe0f344c72276: Merge "Make mode for getting document data without metadata"
rGVED21a5d55b85dd: [BREAKING CHANGE] Store metadata as block nodes in the main data list
T189826: Meta nodes are moved outside of table cells / list items when they appear as their last children, which breaks editing of those tables/lists
T200006: Visual diffs of categories are confusing since categories aren't rendered
T189543: 'commentMeta' nodes appearing as direct children of 'tableRow' / 'list' nodes, which breaks editing of those tables/lists
Event Timeline
Let's see... this is ve.dm.VisualDiff.prototype.flattenList failing when it finds a CommentNode that's a child of a ListNode.
* list item <!--* list item--> * list item
Editing any of the nodes in that list will produce a visual diff which errors out.
Simple attempt at fixing it by doing:
if ( !listContents ) { // Situation like a CommentNode, which doesn't have children, // mixed into a List. flatList.metadata.push( { listNode: listNode, listItem: listItem, depth: depth } ); flatList.nodes.push( listItem ); continue; }
...resulted in a visual diff which didn't report any errors but also never passed the loading bar stage. So, something more subtle goes wrong after that.
@Tchanders: does this bring up anything really obvious which would be wrong, so I don't have to debug more? :D
Having a comment node as a child of a list node seems like a violation of
ve.dm.ListNode.static.childNodeTypes = [ 'listItem' ];
so ideally we would just fix the placement of that comment node (which might be more in @dchan 's ball park)
Make the converter give us a CommentMetaItem instead? We try to do that for things like comments mixed into tables between rows already, I think.
For most MetaItems, their location in the doc isn't meaningful, so we could diff them separately (see also T200006). That would solve the current problem, since the CommentMetaItem would be ignored.
AlienMetaItems and CommentMetaItems are the only meta items where placement is meaningful, but it looks like we still haven't figured out where they should be (T189826 and T189543)...
Change 446850 had a related patch set uploaded (by Tchanders; owner: Tchanders):
[VisualEditor/VisualEditor@master] Make mode for getting document data without metadata
I feel the following code isn't that sensible now that meta items live in the main linear data:
ve.dm.CommentNode.static.toDataElement = function ( domElements, converter ) { var textarea, text; ... return { // Disallows comment nodes between table rows and such type: converter.isValidChildNodeType( 'comment' ) && text !== '' ? 'comment' : 'commentMeta', attributes: { text: text } }; };
Before 21a5d55b85dd098ee0a5f9fdf3edb67841d13939 , this code would have made the awkwardly-placed comment disappear out of the main document tree, but not any more.
Probably we should extend ve.dm.Converter.static.moveInlineMetaItems to move awkwardly-placed block meta items too.
Change 446850 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Make mode for getting document data without metadata
Change 448989 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (e0f344c72)
Change 448989 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (e0f344c72)