Steps to replicate the issue (include links if applicable):
- Open the 2017 editor with a user language different from the page's content language. e.g. page lang = en, user lang = zh-hans
What happens?:
We can see the html element with lang="zh-Hans", the VisualEditor layer (class=ve-ce-documentNode-codeEditor-webkit-hide) with lang="en", which are all good.
But the CodeMirror container doesn't have lang attribute set: <div class="CodeMirror cm-s-default CodeMirror-wrap">
As a result, the browser would choose different fonts for the VisualEditor layer and the CodeMirror layer.
In the Computed tab of the styles inspector, I can see for the VisualEditor layer the rendered font is Consolas;
and for the CodeMirror layer the font chosen is NSimSun which is for zh-hans and is inherited from the root html element.
This might be a recent regression?
What should have happened instead?:
The CodeMirror container has the lang attribute set to en, so the font chosen would be the same as the VisualEditor layer and no misalignment.
Software version (skip for WMF-hosted wikis like Wikipedia):
Other information (browser name/version, screenshots, etc.):
May need some fonts installed for the user language on the machine to reproduce this issue, for me is zh-hans and NSimSun on Windows 10.