* (bug 1438) Fix for diff table layout on very wide lines for Gecko and
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 15 May 2007 21:24:56 +0000 (21:24 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 15 May 2007 21:24:56 +0000 (21:24 +0000)
  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).

RELEASE-NOTES
includes/DefaultSettings.php
includes/DifferenceEngine.php
skins/monobook/main.css

index f7a391b..310bd6e 100644 (file)
@@ -58,6 +58,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 9417) Uploading new versions of images when using Postgres no longer 
   throws warnings.
 * (bug 9908) Using tsearch2 with Postgres 8.1 no longer gives an error.
+* (bug 1438) Fix for diff table layout on very wide lines for Gecko and
+  Opera-based browsers (incomplete, does not fix KHTML or MSIE)
 
 
 == MediaWiki API changes since 1.10 ==
index 5f4bacf..39fda53 100644 (file)
@@ -1125,7 +1125,7 @@ $wgCacheEpoch = '20030516000000';
  * to ensure that client-side caches don't keep obsolete copies of global
  * styles.
  */
-$wgStyleVersion = '67';
+$wgStyleVersion = '68';
 
 
 # Server-side caching:
index af65ce3..7c5518b 100644 (file)
@@ -488,10 +488,10 @@ CONTROL;
                   $ntitle = '<span class="history-deleted">'.$ntitle.'</span>';
                }
                $header = "
-                       <table border='0' width='98%' cellpadding='0' cellspacing='4' class='diff'>
+                       <table border='0' cellpadding='0' cellspacing='4' class='diff'>
                        <tr>
-                               <td colspan='2' width='50%' align='center' class='diff-otitle'>{$otitle}</td>
-                               <td colspan='2' width='50%' align='center' class='diff-ntitle'>{$ntitle}</td>
+                               <td colspan='2' align='center' class='diff-otitle'>{$otitle}</td>
+                               <td colspan='2' align='center' class='diff-ntitle'>{$ntitle}</td>
                        </tr>
                ";
 
@@ -1738,17 +1738,17 @@ class TableDiffFormatter extends DiffFormatter
 
        # HTML-escape parameter before calling this
        function addedLine( $line ) {
-               return "<td>+</td><td class='diff-addedline'>{$line}</td>";
+               return "<td>+</td><td class='diff-addedline'><div>{$line}</div></td>";
        }
 
        # HTML-escape parameter before calling this
        function deletedLine( $line ) {
-               return "<td>-</td><td class='diff-deletedline'>{$line}</td>";
+               return "<td>-</td><td class='diff-deletedline'><div>{$line}</div></td>";
        }
 
        # HTML-escape parameter before calling this
        function contextLine( $line ) {
-               return "<td> </td><td class='diff-context'>{$line}</td>";
+               return "<td> </td><td class='diff-context'><div>{$line}</div></td>";
        }
 
        function emptyLine() {
index f5ddfeb..25a6f34 100644 (file)
@@ -605,6 +605,10 @@ td.diff-context {
        text-decoration: none;
 }
 
+table.diff td div {
+       overflow: auto;
+}
+
 /*
 ** keep the whitespace in front of the ^=, hides rule from konqueror
 ** this is css3, the validator doesn't like it when validating as css2