I was testing https://gerrit.wikimedia.org/r/c/mediawiki/extensions/ContentTranslation/+/462422 (but this error is reproduceable without that patch too) on https://dev.translatewiki.net/w/i.php?title=Special:ContentTranslation&page=Vantaa&from=en&to=es&targettitle=Vantaa&version=2
Assumed steps to reproduce:
# Fill in the paragraphs starting "Vantaa is bordered by" and "The largest airport in Finland"
# Save and refresh the page (not sure if refreshing is necessary)
# Try to edit the only reference [1] on the "The largest airport in Finland" paragraph by double clicking on it
Observed the following error on the console:
```
Uncaught TypeError: Cannot read property 'element' of null
at VeCeCXTransclusionInlineNode.ve.ce.View.initialize (ve.ce.View.js?9c8a2:109)
at VeCeCXTransclusionInlineNode.ve.ce.LeafNode.initialize (ve.ce.LeafNode.js?2240c:45)
at VeCeCXTransclusionInlineNode.ve.ce.GeneratedContentNode.render (ve.ce.GeneratedContentNode.js?4a56e:220)
at VeCeCXTransclusionInlineNode.ve.ce.MWTransclusionNode.render (ve.ce.MWTransclusionNode.js?b8bab:180)
at VeCeCXTransclusionInlineNode.ve.ce.GeneratedContentNode.doneGenerating (ve.ce.GeneratedContentNode.js?4a56e:354)
at ve.ce.GeneratedContentNode.js?4a56e:291
at fire (jquery.js?6a07d:3268)
at Object.fireWith [as resolveWith] (jquery.js?6a07d:3398)
at Object.deferred.(/w/anonymous function) [as resolve] (https://dev.translatewiki.net/w/resources/lib/jquery/jquery.js?6a07d:3736:36)
at VeCeCXTransclusionInlineNode.ve.ce.MWTransclusionNode.onParseSuccess (ve.ce.MWTransclusionNode.js?b8bab:168)
```
Note: There is no direct reference to any CX code in the call stack, except by the class VeCeCXTransclusionInlineNode. Might be something that our subclassing breaks or some of our methods do earlier in the process.
Aside: the reference on the paragraph "Vantaa is bordered by" goes missing in translation.
Aside: trying to fill in the lead section causes {T205420}