Last modified: 2010-05-15 15:33:20 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T3229, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 1229 - Balance diff display more evenly
Balance diff display more evenly
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
History/Diffs (Other open bugs)
1.4.x
PC other
: Low minor with 10 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 2992 6798 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-12-29 19:58 UTC by PS
Modified: 2010-05-15 15:33 UTC (History)
8 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description PS 2004-12-29 19:58:17 UTC
The column widths applied to DIFF need addressing.  

Sometimes one DIFF column is 40 pixels and the other 800+.
Comment 1 Brion Vibber 2005-01-31 07:20:37 UTC
*** Bug 1438 has been marked as a duplicate of this bug. ***
Comment 2 Jeff Bonham 2005-01-31 07:22:51 UTC
Example of wide display lines: 
http://en.wikipedia.org/w/index.php?title=Wikipedia&diff=next&oldid=9818898 
Comment 3 Omegatron 2005-06-23 21:11:49 UTC
This really needs to be fixed.  It makes diff pages completely unusable.

Here is a short discussion:

http://en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_%28technical%29&oldid=14043658#Wiiiiiiide_diff_pages

Four proposed solutions:

* Leave it the way it is - Unacceptable
* Put the long strings in boxes with automatic scrollbars that only appear with
wide text - My favorite, if implemented for each td /td separately - related to
Bug 414
* Break long text strings (which slashdot does, to avoid page-widening attacks)
- My second favorite
* Clip long strings to the rect of the two diff columns - Destroys information

Good examples:

http://en.wikipedia.org/w/index.php?title=RTFM&diff=12625368&oldid=12536687
http://en.wikipedia.org/w/index.php?title=Nikola_Tesla&diff=0&oldid=13515391
Comment 4 Omegatron 2005-06-29 23:56:26 UTC
Ok, I think that all you have to do to fix this for Firefoxers is change some
lines in DifferenceEngine.php:

	# HTML-escape parameter before calling this
	function addedLine( $line ) {
		return "<td>+</td><td class='diff-addedline'>{$line}</td>";
	}

	# HTML-escape parameter before calling this
	function deletedLine( $line ) {
		return "<td>-</td><td class='diff-deletedline'>{$line}</td>";
	}

	# HTML-escape parameter before calling this
	function contextLine( $line ) {
		return "<td> </td><td class='diff-context'>{$line}</td>";
	}

Should become:

	# HTML-escape parameter before calling this
	function addedLine( $line ) {
		return "<td>+</td><td class='diff-addedline'><div
class="diffblock">{$line}</div></td>";
	}

	# HTML-escape parameter before calling this
	function deletedLine( $line ) {
		return "<td>-</td><td class='diff-deletedline'><div
class="diffblock">{$line}</div></td>";
	}

	# HTML-escape parameter before calling this
	function contextLine( $line ) {
		return "<td> </td><td class='diff-context'><div
class="diffblock">{$line}</div></td>";
	}

Or class="diffparagraph" or something like that. Then add:

.diffblock {overflow: auto;}

to the css. I don't have a way to try this myself.
Comment 5 Omegatron 2005-07-22 01:09:57 UTC
(In reply to comment #4)
> Ok, I think that all you have to do to fix this for Firefoxers is change some
> lines in DifferenceEngine.php:

Apparently DIVs inside TDs is bad HTML.

Oh well.
Comment 6 Brion Vibber 2005-07-29 08:53:09 UTC
*** Bug 2992 has been marked as a duplicate of this bug. ***
Comment 7 Omegatron 2005-08-06 00:12:39 UTC
(In reply to comment #5)
> Apparently DIVs inside TDs is bad HTML.

I have now been told that DIVs inside TDs is perfectly valid HTML:

http://www.w3.org/TR/html4/sgml/dtd.html
Comment 8 Cesar Eduardo Barros 2005-08-06 02:50:13 UTC
To test Omegatron's proposed solution, you can use the following in your user
js: http://en.wikipedia.org/w/index.php?title=User:CesarB/monobook.js&oldid=19891279

For some reason, it does not work always; some extreme cases where it fails
badly are at http://en.wikipedia.org/wiki/User_talk:CesarB/monobook.js (the
first one is particularly bad).
Comment 9 Zigger 2006-01-05 05:52:44 UTC
*** Bug 4494 has been marked as a duplicate of this bug. ***
Comment 10 Omegatron 2006-01-12 05:30:11 UTC
javascript workaround here:

http://en.wikipedia.org/wiki/Wikipedia:WikiProject_User_scripts/Scripts/Fix_diff_width
Comment 11 Omegatron 2006-01-14 03:09:34 UTC
The javascript workaround rewrites the diff display in css instead of a table,
and is known to work in Firefox, Konqueror, Opera and at least some versions of
Internet Explorer.

I'd like it if Mediawiki output code like this instead of the table it currently
outputs.  It just has to be changed to output spans and divs instead of the tds
it uses now.

Also, using tables for visual layout is bad.  Just ask a google search.

I'm going to change the Severity away from enhancement, since the super wide
pages can be considered a bug.
Comment 12 Omegatron 2006-01-14 03:13:00 UTC
Oh yeah.  Discussion here:

http://en.wikipedia.org/wiki/User_talk:Ilmari_Karonen#Diff_width_fixer
Comment 13 Minh Nguyễn 2006-01-14 23:02:24 UTC
Hmmm... diffs might qualify as a proper usage of tables, though; after all, the
contents of each line are data, and we're not just putting it in the table to
make it look nice. (We can't say the same for so many other uses of tables at
Wikipedia.) One thing I'll miss about the table-based diffs is the ability to
Ctrl-click a cell and copy the contents of an entire line to the clipboard.
There's really no easy way of doing that with CSS.
Comment 14 Omegatron 2006-01-25 14:32:57 UTC
(In reply to comment #13)
> Hmmm... diffs might qualify as a proper usage of tables, though; after all, the
> contents of each line are data, and we're not just putting it in the table to
> make it look nice. (We can't say the same for so many other uses of tables at
> Wikipedia.) 

You're right.  With css turned off it just becomes a mess of text.  Is there any
way to use tables but still render correctly?
Comment 15 lɛʁi לערי ריינהארט 2006-01-30 21:06:22 UTC
(In reply to comment #10)
> javascript workaround here:
> 
>
http://en.wikipedia.org/wiki/Wikipedia:WikiProject_User_scripts/Scripts/Fix_diff_width

Thanks Omegatron for this note about the workaround!

However the colors for added / deleted do not show properly at
http://yi.wiktionary.org/w/index.php?title=%D7%91%D7%90%D6%B7%D7%A0%D7%99%D7%A6%D7%A2%D7%A8:Gangleri/monobook.js&diff=prev&oldid=7478
using Windows 2000 SP 2, FF 1.5 and IE 6.0
but they show properly at
http://yi.wiktionary.org/w/index.php?title=%D7%91%D7%90%D6%B7%D7%A0%D7%99%D7%A6%D7%A2%D7%A8:Gangleri/monobook.js&diff=next&oldid=7478

best regards reinhardt [[user:gangleri]]
Comment 16 Omegatron 2006-01-30 21:21:25 UTC
(In reply to comment #15)

> However the colors for added / deleted do not show properly at

I didn't write it.  :-)  Ask on the Wikiproject page.

I will ask both there and here:

Is there a way to get this formatting at the same time as the table markup?
Comment 17 lɛʁi לערי ריינהארט 2006-01-30 21:43:23 UTC
(In reply to comment #16)
Thanks Omegatron!

----
Please see also bug 4801 comment 0
Bug 4801: user:foo/monobook.js does not render in preview

re: Bug 1229: Please change "OS" and "Hardware" if you experience this behaviour
at other
operating systems and / or hardware. Thanks in advance!

best regards reinhardt [[user:gangleri]]
Comment 18 lɛʁi לערי ריינהארט 2006-01-30 22:59:12 UTC
*addendum*

RTL wikies should show the current version on the left side; see
http://yi.wiktionary.org/w/index.php?title=user:Gangleri/monobook.js&diff=7485&oldid=7479

Behaviour depends on the wikies. Please make the tests at commons:, meta, b:,
n:, s:, q:, wikt; w:.

Thanks in advance!

best regards reinhardt [[user:gangleri]]
Comment 19 Ilmari Karonen 2006-01-31 07:01:20 UTC
(In reply to comment #14)
> 
> You're right.  With css turned off it just becomes a mess of text.  Is there any
> way to use tables but still render correctly?

I haven't found one, though I just realized that it might be possible with some
creative application of display:block.  I'll have to test it to see if browsers
will actually support it.

With the current version, turning off CSS will put each cell on one line, making
the result look almost like a unified context diff (diff -u) except that each
context line is duplicated.  I haven't found any way around that either, but at
least it should be more or less readable in browsers like lynx.
Comment 20 Ilmari Karonen 2006-01-31 07:35:16 UTC
(In reply to comment #18)
> 
> RTL wikies should show the current version on the left side; see
>
http://yi.wiktionary.org/w/index.php?title=user:Gangleri/monobook.js&diff=7485&oldid=7479

The columns can easily be swapped by setting the float property of .xdiff-col to
"right".  However, the signs will still be on the left side of the columns.  I
think I know how to fix it, but it requires changing the DOM structure again. 
I'll try to address the issue in the next revision; ideally changing the display
from LTR to RTL should be as easy as uncommenting one line of CSS.
Comment 21 Minh Nguyễn 2006-01-31 19:39:51 UTC
(In reply to comment #19)
> (In reply to comment #14)
> > 
> > You're right.  With css turned off it just becomes a mess of text.  Is there any
> > way to use tables but still render correctly?
> 
> I haven't found one, though I just realized that it might be possible with some
> creative application of display:block.  I'll have to test it to see if browsers
> will actually support it.
> 
> With the current version, turning off CSS will put each cell on one line, making
> the result look almost like a unified context diff (diff -u) except that each
> context line is duplicated.  I haven't found any way around that either, but at
> least it should be more or less readable in browsers like lynx.

Still, tables seem like the most appropriate way to handle diffs, and it's a
pity that we have to come with workarounds for functionality that tables already
offer (albeit with annoyingly uneven columns).
Comment 22 Omegatron 2006-01-31 21:25:39 UTC
(In reply to comment #21)

> Still, tables seem like the most appropriate way to handle diffs, and it's a
> pity that we have to come with workarounds for functionality that tables already
> offer (albeit with annoyingly uneven columns).

Ilmari, did you see my first implementation where the DIVs were inside TDs?  I
don't know if it's a "proper" way to do it, and it got slow on mine on large
pages, but it *did* work in Firefox, and combined the logicalness of tables with
the 50% width of css formatting...  Just a thought.  I'm not a CSS guru or anything.
Comment 23 Stewart Gordon 2006-02-15 14:20:29 UTC
(In reply to comment #11)
> The javascript workaround rewrites the diff display in css instead of a table,
> and is known to work in Firefox, Konqueror, Opera and at least some versions of
> Internet Explorer.
> 
> I'd like it if Mediawiki output code like this instead of the table it currently
> outputs.  It just has to be changed to output spans and divs instead of the tds
> it uses now.
> 
> Also, using tables for visual layout is bad.  Just ask a google search.

This isn't using tables for visual layout.  It's a perfectly legitimate use of
tables for marking up tabular data.  Each row denotes a paragraph that has
changed (or is next to one that has), and each column denotes a version of the
document.

And while I'm at it, I shall remind you all that this bug is about the widths of
the diff columns relative to each other.  One erroneous dupe seems to have made
the topic of discussion drift....
Comment 24 Brion Vibber 2007-05-16 18:03:29 UTC
r22204 for bug 1438 will have fixed this as well, using fixed table layout and
forcing overflow to scroll.
Comment 25 Chad H. 2010-01-14 00:55:48 UTC
*** Bug 6798 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links