On Fri, Apr 3, 2009 at 6:44 AM, Håkon Wium Lie <howcome(a)opera.com> wrote:
I've spent the last few days analyzing
Wikipedia's HTML code for
images and captions. The current code is quite good, but verbose and
it has redundancies. Here is a proposal that describes how to simplify
and improve the code:
http://www.princexml.com/howcome/2009/wikipedia/image/
The proposed solution reduces the number of elements from 10 to 6 and
the code size is reduced by more than 50%.
As others have noted, the thumbnails can actually be any size, so we
really do need to use style="" for that (or at least height/width on
the <img>). I guess we could use a class for the relatively common
case, but I don't see the gain, honestly.
I noticed you removed the " /" closing the <img> tags -- we use XHTML
1.0 for the moment, so we have to keep that (four more bytes! :) ).
For the same reason, we need to keep alt="" -- it's stupid, since
really the semantics we want is "we have no idea what the alt text
should be since the users didn't specify it" rather than "this
deserves no alt text", but we don't have any way to express the former
in XHTML 1.0. We currently do have the goal of maintaining XHTML 1.0
conformance where possible, stupid though it may be at times.
I'm not sure about the "enlarge" icon. It might not be intuitive that
clicking on the image expands it. The icon itself might not be so
great either, though. Personally, I won't remove that for now.
I agree that the title attribute is pointless if there's a caption --
removing that would be good. (If I can figure out how. The code for
this is *awful*. So not this second.) I removed the border="0" in
r49154.
The rest (i.e., the bulk of the proposal) is more complicated and will
require more care to implement, which I can't give at this exact
second.
On Fri, Apr 3, 2009 at 10:22 AM, Stephen Bain <stephen.bain(a)gmail.com> wrote:
From the point of view of such users removing the alt
attributes on
images is a bad idea.
If an empty alt attribute and a nonexistent one are handled
differently by anything, I'd guess a nonexistent one would be handled
better, not worse, for our semantics. But XHTML requires the
attribute, in any event.