r22192 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r22191‎ | r22192 | r22193 >
Date:21:24, 15 May 2007
Author:brion
Status:old
Tags:
Comment:
* (bug 1438) Fix for diff table layout on very wide lines for Gecko and
Opera-based browsers (incomplete, does not fix KHTML or MSIE)

This adds a <div> inside the <td> for diff content cells, and declares
the style for these <div>s to have overflow: auto.

In Gecko (tested Firefox 2.0) and Opera (tested 9.10 and over) this does
two things:
* The table layout treats the cells as the requested width instead of bloating
out to the widest line of content, so the table stays visible on screen
* The individual cells that are too long get horizontal scroll bars

Unfortunately this doesn't have the hoped-for effects in other tested browsers:
* MSIE 7
* Safari 2
* Konqueror 3.5
* iCab 3

But neither has it any ill effects, so... it's a start.
There's probably some other way to force the layout algorithm to behave
that I haven't quite stumbled on yet... Might have better luck with the
fixed table layout option, though that seems less friendly to the little
+ and - columns.

The C++ diff plugins will have to be updated to support this scheme, but
no harm will be done if they're not (just they won't do anything new).
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/DifferenceEngine.php (modified) (history)
  • /trunk/phase3/skins/monobook/main.css (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/monobook/main.css
@@ -605,6 +605,10 @@
606606 text-decoration: none;
607607 }
608608
 609+table.diff td div {
 610+ overflow: auto;
 611+}
 612+
609613 /*
610614 ** keep the whitespace in front of the ^=, hides rule from konqueror
611615 ** this is css3, the validator doesn't like it when validating as css2
Index: trunk/phase3/includes/DifferenceEngine.php
@@ -488,10 +488,10 @@
489489 $ntitle = '<span class="history-deleted">'.$ntitle.'</span>';
490490 }
491491 $header = "
492 - <table border='0' width='98%' cellpadding='0' cellspacing='4' class='diff'>
 492+ <table border='0' cellpadding='0' cellspacing='4' class='diff'>
493493 <tr>
494 - <td colspan='2' width='50%' align='center' class='diff-otitle'>{$otitle}</td>
495 - <td colspan='2' width='50%' align='center' class='diff-ntitle'>{$ntitle}</td>
 494+ <td colspan='2' align='center' class='diff-otitle'>{$otitle}</td>
 495+ <td colspan='2' align='center' class='diff-ntitle'>{$ntitle}</td>
496496 </tr>
497497 ";
498498
@@ -1738,17 +1738,17 @@
17391739
17401740 # HTML-escape parameter before calling this
17411741 function addedLine( $line ) {
1742 - return "<td>+</td><td class='diff-addedline'>{$line}</td>";
 1742+ return "<td>+</td><td class='diff-addedline'><div>{$line}</div></td>";
17431743 }
17441744
17451745 # HTML-escape parameter before calling this
17461746 function deletedLine( $line ) {
1747 - return "<td>-</td><td class='diff-deletedline'>{$line}</td>";
 1747+ return "<td>-</td><td class='diff-deletedline'><div>{$line}</div></td>";
17481748 }
17491749
17501750 # HTML-escape parameter before calling this
17511751 function contextLine( $line ) {
1752 - return "<td> </td><td class='diff-context'>{$line}</td>";
 1752+ return "<td> </td><td class='diff-context'><div>{$line}</div></td>";
17531753 }
17541754
17551755 function emptyLine() {
Index: trunk/phase3/includes/DefaultSettings.php
@@ -1125,7 +1125,7 @@
11261126 * to ensure that client-side caches don't keep obsolete copies of global
11271127 * styles.
11281128 */
1129 -$wgStyleVersion = '67';
 1129+$wgStyleVersion = '68';
11301130
11311131
11321132 # Server-side caching:
Index: trunk/phase3/RELEASE-NOTES
@@ -58,6 +58,8 @@
5959 * (bug 9417) Uploading new versions of images when using Postgres no longer
6060 throws warnings.
6161 * (bug 9908) Using tsearch2 with Postgres 8.1 no longer gives an error.
 62+* (bug 1438) Fix for diff table layout on very wide lines for Gecko and
 63+ Opera-based browsers (incomplete, does not fix KHTML or MSIE)
6264
6365
6466 == MediaWiki API changes since 1.10 ==

Follow-up revisions

RevisionCommit summaryAuthorDate
r22204* (bug 1438) Fix for diff table layout on very wide lines....brion17:57, 16 May 2007