Page MenuHomePhabricator

Copy-Paste: VE should add rev-id attributes to content pasted from other wikipages
Open, Stalled, MediumPublic


This is the summary of an IRC discussion that @Esanders and I had today.

As noted in T116460 and other similar bug reports, when content is copied from a different page into VE, unless VE strips / disambiguates the ids from the source page, Parsoid might corrupt the copied content on the target page by reusing data-parsoid for copied content where the ids for those elements happen to match ids on the target page.

To prevent this, the interim strategy in T116460 is to strip these ids. However, if VE is able to add rev-ids to these elements instead, Parsoid will be able to disambiguate these ids as being from a different page and do one of two things (a) fetch the data-parsoid attributes from that rev-id and use that instead (b) drop ids from these elements till functionality in (a) is in place.

For proper disambiguation, at the very least, these rev-id attributes would have to be added to the root of every subtree in the pasted content. It is upto VE whether they want to do this for every element in the pasted content or the subtree roots.

We didn't bikeshed the name of this revid attribute, but perhaps data-mw-revid?

<tangent>We briefly considered the idea of VE fetching the data-parsoid attributes on its end and adding them inline (on paste), but that requires async support to some of that code which doesn't exist. Besides that, it makes more sense to do this in Parsoid so other editing clients get similar copy-paste support. I am adding this note here only for completeness in case someone else raises this. </tangent>

Event Timeline

ssastry raised the priority of this task from to Medium.
ssastry updated the task description. (Show Details)
ssastry added subscribers: ssastry, Esanders.

I think data-mw-revid would imply it was related to data-mw and not data-parsoid, so maybe just data-revid? VE will implement this after Parsoid.

Also we will apply the data-revid to any element with a data-id, not just the root, in case the HTML is modified in another editor before being pasted back to VE.

ssastry set Security to None.
Jdforrester-WMF changed the task status from Open to Stalled.Nov 24 2015, 8:24 PM