Filed under: html

WebKit's Drama of Broken Image Alternative Text

Any web developer worth his salt knows you're supposed to put an "alt" attribute on your images. 

What's an alt attribute you ask? Well, imagine you're blind, or maybe your connection is slow, or you just hate looking at images. In an HTML page,  an <img> tag's alt attribute tells the browser what the image means when the image can't be seen. 

<img src='/images/lolcat1.jpeg' alt='a cat asking if it can haz a cheezburger'>

Screen reader software can read the value of the attribute aloud to a sight impaired person. 

The thing about images is that they are separate files from the web pages they are displayed in. Everyone's familiar with the broken image icon that appears when an image fails to load or has been moved. You might think that if the <img> tag had an alt attribute that would be a perfect opportunity to use it. After all some web developer went to the trouble of putting it there why not go ahead and display it? Firefox and Opera do just that. 

Of course Internet Explorer doesn't (no shock there) but surprisingly neither does Safari, or Chrome. These browsers ignore the alt attribute and just display the broken image icon. If all the images on the web suddenly disappeared, blind people would still know what the images were, but users of IE, Safari, and Chrome would be left in the dark. 

By now I'm sure you're on the edge of your seat and who can blame you? This is important stuff! Many people have reported this issue as a bug in Chromium (the open source project behind Google Chrome) since as far back as 2008. "Firefox and Opera do it right!" they cry. "Why do we spend hours optimising our code for situations like this, only to find it's all a complete waste of time?" But the bug's owners simply pass the buck, saying the bug is in WebKit, (the opensource project behind the software that powers both Chromium and Safari... stay with me now) and has been there since 2005! And I thought I was bad at closing bugs!

Those of you involved in web technologies probably already suspect there is some pedantic debate over some minute detail at the heart of this and BOY IS THERE EVER! It seems people in the Chromium camp can't decide whether the alt attribute should be displayed or the similar title attribute (the attribute responsible for the little tooltip text that pops up under your cursor from time to time). 

Meanwhile at WebKit they are struggling to understand what everyone's getting on about. Back in 2006 a guy named Hixie offered the spec he did for Mozilla on the subject, and the WebKit developers thought about it for two more years. Then in 2009 OmniGroup (another browser maker that uses WebKit, you're still reading this?) provided an actual fix to the bug which they had patched for their OmniWeb browser. All that remained was for WebKit developers to apply the patch, and all would be solved!

They talked about it some more. "This is solely for the (questionable) benefit of sighted users" said one. "I know that I generally don't want any content that's normally invisible to suddenly become visible when images get lost [even when that content was meant to be visible when the images aren't visible]" chimed in another. Again some external links were shared where people outside of WebKit said what everyone inside of WebKit seemed to have such a hard time understanding "The reader of the page frankly couldn't care less if the author has made a mistake and the page is not completely available. The reader wants the information." Still they were not convinced. 

The main concern seems to be that if an <img> tag doesn't have specific dimensions the alternate text might stretch the image's box wider than it should be. This would be catastrophic for sites like the Internet Archive (I don't know what that site is either, but it's really important to the WebKit devs) where they apparently lose images all the time and do not care what they were supposed to be whatsoever. Of course, the broken image icon is just as likely to be too small, but *that's* okay. The developer who provided the alt attribute might also provide a width which would keep their page looking fine. But all this just seems to be too big of a choice for the poor WebKit team, and as of last November they have fallen silent on the issue. 

I would like to see this fixed, mainly because I don't feel like opening Photoshop to make a little pencil icon right now, so I'd like my <img> tag to just say "edit" instead of the same icon as the "delete" tag right next to it which could say "delete" just like the alt attribute tells it to. Maybe I should have just replaced the <img> tag with text for now and gone on with my life. But I noticed that just yesterday some Chrome users decided to get noisy about this issue. This is the kind of crap that web developers have put up with since the web was born, but this is a new day dammit! This is HTML5, this is freakin' Web3.0! We do not want debates about what would maintain the status quo. We want progress! So I'm jumping on this bandwagon, and I will see this behavior standardized if it means forking the whole damned WebKit project! I've had it with engineers that can't make a fucking decision. Shit or get off the pot WebKit.
1 of 1
Posterous theme by Cory Watilo