From IRC:
[14:44] <gwicke> subbu, re https://bugzilla.wikimedia.org/show_bug.cgi?id=51217#c9: we should be able to detect when something was fostered out by our treebuilder, and should also be able to ensure that everything fosterable is dropped or fostered at the end of DOMPostProcessing
[14:45] <gwicke> yeah, I wonder what he is up to
[14:45] <subbu> in that example, what do we do with the information at all .. itis not helpful since the output still looks corrupt.
[14:45] <gwicke> subbu: IMO it is fine to drop such content on edit, but if we can avoid dirty diffs with selser then that would be great
[14:46] <gwicke> we could strip the fostered content from the DOM
[14:46] <subbu> is it the right thing to do in general?
[14:46] <gwicke> and rig selser so that it restores it unless the content is touched 
[14:47] <gwicke> or we can keep it in the DOM, but mark it so that selser does not serialize it
[14:47] <gwicke> ie, a zero-length dsr
[14:48] <subbu> yes, the rig-selser bit is missing right now.
[14:48] <gwicke> subbu: detecting foster-parented content and then excluding it from dsr calculations might already be pretty effective
[14:49] <gwicke> I guess the gaps in dsr would be spanned by the dsr algorithm
[14:49] <subbu> yes, that should work.
[14:49] <gwicke> (the holes where content disappeared)
[14:50] <subbu> i was wondering if we should mark blocks of fostered content with a special div/marker so that VE can treat it specially if there is a use-case for it (not sure there is ..)
[14:50] <gwicke> subbu: I'd vote for data-parsoid
[14:50] <subbu> data-parsoid is fine for internal use.
[14:50] <gwicke> if the user edits the fostered content, we serialize it
[14:50] <gwicke> i.e., do the dirty diff then
[14:51] <subbu> but, i mean: if VE can do something special if it knew about it.  not sure what that would be .. i doubt this is a high priority thing in any case.
[14:51] <gwicke> when something adjacent to the former location is edited, we dirty-diff it there
[14:51] <gwicke> subbu: IMO we should abstract such issues
[14:52] <gwicke> bot authors would not want to deal with it either
[14:52] <gwicke> and the DOM should reflect the rendered semantics 
[14:53] <subbu> dom should reflect rendered semantics for sure.