First I was thinking that other components are affected as well, but only auto-components get their markup set via setMarkup(), which is why they don't need to know how to find their markup. But than I found this:
// We need to keep InlineEnclosures for Ajax request handling.
// TODO this is really ugly. Feature request for 1.5: change auto-component that
// they don't need to be removed anymore.
if (component.isAuto() && !(component instanceof InlineEnclosure))
which makes me belief that the problem is limited to InlineEnclosure only. I think we have two options. Either the way it's implemented in your patch (InlineEnclosure implements getMarkup()) or InlineEnclosure gets a variable markup which is not reset. Any variation change has no effect on InlineEnclosure ajax upates anyway, since the markup will not be reloaded under any circumstances.
Pseudo code: InlineEnclosure
// avoid all the extra info which come with IMF implementations
private String markup
IMF markup = super.getMarkup();
// resolver has set markup upon auto-component creation. Local markup not yet set => remember
if (markup != null && this.markup == null)
this.markup = markup.toString()
// markup == null because of detach, but we have our local copy => use copy to set markup
else if (markup == null && this.markup != null)
markup = Markup.of(this.markup)