This is a bug of VisualDiff.
The way to reproduce:
- Enable VisualDiff in preferences,
- Go to any diff page, like this,
- And look at the HTML.
We can find two <div>'s have the same ID: #mw-diff-ntitle1. Actually, any HTML containing two tags sharing the same ID will be invalid. It affected some gadgets like Twinkle which use getElementById and want to get the tag in diffmode=source but got diffmode=visual one, because it appears before the other one in HTML code.
(Sorry for my poor English, not a native speaker.)