Page MenuHomePhabricator

Live diff appears with big white space when run on top of a server-provided empty diff
Open, Needs TriagePublicBUG REPORT


List of steps to reproduce (step by step, including full links if applicable):

  • Open the edit form of any existing page (e.g. Wikipedia:Sandbox)
  • Click "Show changes" without changing the text and without live preview on (e.g. run $(document.body).off(); $('#wpDiff')[0].click(); in console if live preview is on)
  • Confirm you are navigated to an action=submit page with text "(No difference)"
  • Modify the text and click "Show changes" with live preview on (e.g. run mw.loader.using('mediawiki.action.edit.preview', () => { $('#wpDiff')[0].click(); }); in console if live preview is off)

What happens?:
The wiki markup columns (2nd and 4th) in the diff table take up only half the usual width, with significant white space next to them.

diff_half.png (290×1 px, 15 KB)

What should have happened instead?:
The columns occupy most of the diff table.

diff.png (314×1 px, 16 KB)

This appears to be because

<col class="diff-marker">
<col class="diff-content">
<col class="diff-marker">
<col class="diff-content">

is missing after <table class="diff">, which has the CSS table-layout: fixed;, causing the column widths to distribute evenly because the first row is just two <td colspan="2">s.

I know this is an unlikely scenario by itself but to avoid these kinds of nuisances perhaps the script should simply reconstruct the table each time rather than reuse existing ones.