Hixie's Natural Log

2006-08-07 11:27 UTC The sacrifice of pragmatism over theoretical purity

A while back I mentioned that the HTTP Content-Type header was effectively dead on the Web, with Web browsers being forced by market demand to ignore authoritative metadata regarding data formats, in favour of having Web browsers automatically determine the type of the content the user is viewing.

In particular, this is required for video on the Web — millions of videos are served as text/plain and a Web browser that displays garbage instead of showing the video is one that will get very few happy users — and for feeds (RSS, Atom, etc), which are more often than not served as text/html despite being XML. (As a side note, a little over two years ago Mark Pilgrim pointed out that XML on the Web was dead too, also because of feeds. Seems these popular feeds could be responsible for the destruction of the Web!) It's also needed for images — many images are sent using the completely wrong MIME type, e.g. GIFs as image/png, or PNGs as text/plain, or JPEGs as application/octet-stream, and browsers uniformly ignore the MIME type when it comes to <img> elements. Same with scripts — it doesn't matter what you label your JavaScript files as, at all; when it comes to <script> elements, browsers uniformly ignore the HTTP Content-Type header and rely exclusively on the attributes on the element.

However, it seems that these real world concerns are not a factor in the TAG's findings, since the day after I posted the aforementioned blog post, they published a document describing how browsers must always follow Content-Type headers, how specifications must never require browsers to ignore such headers, and how authors must all go and correct their mis-configured servers. (I only recently became aware of this document, I don't normally follow the W3C TAG.)

I'm curious as to how they're going to go about making people follow their recommendations. Until the servers are fixed, browsers can't fix their behaviour, because users would consider the spec-compliant behaviour to be a regression ("the previous version showed the video, the new version just shows garbage"). So that means that they presumably are going to get all the servers fixed.

But how?

Until then, HTML5 is going to continue the pragmatic route, and will be requiring UAs to ignore Content-Type in certain situations (mostly those I mentioned above). It sucks, but I'd rather have the spec be implementable in the face of real world content than have it be uniformly ignored.

Pingbacks: 1

2006-07-30 12:00 UTC The Torment of Tantalus

Well if you-
ever pla-n
to motor west,

Jack; take my way;
it's the highway
that's the best!

Get your kicks
on route
sixty six.

A few weeks ago I ordered Stargate SG-1 Season 9 from Amazon. The package soon arrived, but contained Stargate SG-1 Season 8. Season 9 hasn't been released yet. Amazon refunded my credit card and apologised for the mislabelling on the site. I didn't want a chargeback. I wanted Season 9! After all, Season 10 is being broadcast on the networks, how long do I have to wait? Could they at least put the episodes up on Google Video or the iTunes Music Store or something (side note: while looking up the syntax of iTunes Music Store URIs I came across the most romantic blog post I've ever read) so I could buy them before the DVDs come out? Don't they understand that they have fans who don't have a TV? Still, that's not Amazon's fault. I was impressed that Amazon volunteered to do a chargeback without the slightest reluctance between 6pm on Friday (when I received the package and filed the complaint) and Saturday morning (when they sent me the e-mail confirming their mistake).

Well it wi-nds
from Chicago
to L. A.

thousand miles

all the way.

Get your kicks
on route
sixty six.

Also in the package from Amazon was the Cars soundtrack (yay!), with two versions of Route 66. It's strange how Americans rhapsodise about their roads. You never hear Brits sing about the virtues of the M4, or wax lyrical about the A350. While musing on this I came across a remake of Route 66 but about the A13. The differences between the original and this version are symbolic in so many ways.

Well it go-es through Saint Louis,
Jo-plin, Missouri;
Oklahoma City looks oh!-so-pretty. You'll see-e...
ah-Gallup, New Mexico;

In other news, Eira and Dag visited for a few days, which was nice. We went to the beach, where I dug a hole for my ball and didn't trip into it (though Eira did). My beach ball this time was a lot larger than last time, for reasons that I won't go into that involved three very kind shopkeepers in Santa Cruz and a mechanical foot pump. Some evil person covered me in sand while I was reading my book.

Flagstaff, Arizona;
don't forget Winona;
Kingman, Barstow, Sa-n Bernardino! Won't you-
get hip to-this timely tip

and take
that Califorina trip.

The ocean is cold.

Get your kicks
on route
sixty six.

We also visited San Francisco, where I saw Superman (much better than I expected), and failed to see more than three sea lions (it's the summer), and ate at a very nice Cafe, called Cafe Divine, at Union and Stockton. After eating at the latter, which I must emphasise was very good in every respect, we spent a few hours in the nearby park. The sun was so bright that I found that I could read my laptop screen with the backlight turned off. I love my Powerbook.

While Eira and Dag were here we went to visit one of Dag's old friends, who used to work for SGI. He showed us a watch, made by Tag Heuer, which SGI had given him and which he hadn't looked at for some ten years or so. "What time is it?" I asked. "About thirty minutes past eleven." "Exactly how many minutes past eleven?" "Twenty-three past eleven." I laughed and tossed the watch back to Dag's friend, remarking upon the proficiency of Swiss horology with a quip like "Swiss made, baby!" (Tag Heuer is a Swiss brand.) Upon further investigation we found that the watch, which had been set to an accuracy of plus-or-minus one second back several years ago using NTP, was now only three seconds out of sync according to NTP.

There have been three leap seconds in the last ten years.

It-goes: through-Saint-Louis!
Oklahoma City looks ohh! so- pretty. You'll see...
ah-Gallup, New Mexico;

The week after that I bought a Mac Mini. It now runs my trains. I also bought a Linksys router which prominently mentioned the GPL on its packaging, and flashed it with a custom Linux-based firmware. This brings the total number of computers in my flat to an unreasonable five, running Windows XP, PowerPC Mac OS X, Intel Mac OS X, a Fedora Core distribution, and an embedded Linux distribution.

Flagstaff, Arizona;
don't forget Winona;
Kingman, Barstow, Sa-n Bernardino! Won't you-
get hip to this timely tip?

Speaking of my trains, Kerz and I are now starting to add levels to our layout. Today we went out and bought styrofoam (which it turns out is far cheaper at Home Depot, where it costs something like $20 per sheet, than at House of Foam, where it costs something like $220 per sheet). Boy does cutting this stuff make a mess. But we did good progress, and I'm very happy. We desperately need some 6017s and 6001s to power the track, though, it's somewhat sad how little power there is in the tracks. Adding hills isn't going to help matters.

Take- that California trip?

A few days ago I came across Eternal Flame, a parody recorded on Eli's label (Eli was my landlord/flatmate when I was an intern at Netscape). I mention this because of one line of the lyrics which totally floored me for no apparent reason: "...the Lord could not count grains of sand with a 32 bit word".

Get your kicks
on route
sixty six.

Who does 32bit maths these days anyway. All the code I've written recently is 64bit-native, isn't yours?

Get your kicks
on route
sixty six.

When I'm not doing all the above fun things, or relaxing at Bab5 (mmmmm, hot tub...), or playing board games, or going rock climbing at the gym in Sunnyvale, or trying to turn Aardvarks into Fearsome Nobles, or playing Jazz with colleagues, I sometimes watch videos online. Some of them are apparently part of modern pop culture, some are shorts that made the Canne Film Festival, others are tech talks.

And I'll meet you-u
on route
sixty two;

My current project at work is to specify, in near-complete detail, the document.write() DOM API, for both HTML and XHTML. This is proving non-trivial. Another word would be "challenging". I haven't yet thrown myself off the Googleplex roof, but it is an ever-present risk when having to deal with the insanity of browsers.

Get your kicks
on route
sixty six.

2006-06-29 20:20 UTC How to make namespaces in XML easier

I was thinking this morning about a possible extension to the Namespaces in XML spec that might make life easier for authors.

<html xmlns="import svg xbl html">
   <rect .../>

That is, add a new feature: the default namespace URI, if it starts with the string "import" followed by a space, is a space-separated list of keywords representing namespaces from which to look up each element. So in the example above, the "html" element is in the HTML namespace, the "body" element is too, the "svg" element is in the SVG namespace, and the "rect" element is in the SVG namespace. UAs would have a hardcoded list (given in the spec for this feature) of which element names are in which namespace, to make this possible. That way authors don't have to remember namespace URIs and they don't have to deal with namespace prefixes. Clashes would be solved by picking the first namespace in the author's list. Unknown elements would end up either in the last namespace specified, or the "" non-namespace, whichever way it was defined.

Alternatively we could have xmlns="web document", maybe, which would simply have the same effect but with a hard-coded list of namespaces and element names, so the authors don't even have to remember which languages to import. That would be less flexible, but the flexibility might not be needed.

The problem with this is how to introduce new element names; there'd be a long lag before people could start using them. That would be a reason to pick the namespace most likely to get new names as the default. Note that this wouldn't clash with existing usage of xmlns since you can't have a space in a valid namespace URI today.

2006-06-25 23:23 UTC Yosemite (and stuff)

I love how Microsoft announce all their news long before they actually do whatever it is they announced. "Our next operating system will rock! In three years. Maybe four." "Our browser is going to be amazing! It will ship next year." "Our search engine will be better than the competition! In six months." (That last one is especially funny to me since they keep saying it every six months, as far as I can tell.) But I'm especially amused by the latest one: "Our CEO will quit! In two years."

Can't fault them for consistency.

My parents came to visit so we went to see Yosemite. On the way we stopped at the self-proclaimed oldest saloon in California.

Yosemite is a mountainous area. It's hard to explain the sheer scale of some of the cliffs in and around Yosemite valley; photographs don't do it justice.

Yosemite has cute wildlife (as well as insects). We didn't see any bears or mountain lions, but we did see lots of birds, squirrels, and deers.

And of course, trees.

I'm getting to really like Amazon. I'm a little scared by quite how easy they make spending money. I've got to learn not to use Free Super Saver Shipping, though, it's far too slow. Either that, or I need to start buying stuff more often, so that I have a steady stream of packages arriving. The problem is that buying online doesn't give me the instant satisfaction of buying in a shop. Although... iTunes even beats shops, you get the stuff Right Then, without having to even get dressed. Er, I mean, without having to go to a shop. Right.

Pingbacks: 1 2

2006-06-12 02:43 UTC Ranting on the Caltrain

On Friday I saw Cars, the best movie of the year. (Pixar only release one movie per year, so it's easy to say which the best movie of the year is.) Stupendous. The sheer amount of detail in every shot is awe-inspiring. The story was unoriginal, as stories go, but that's the only criticism I could level at the movie. The story's execution was flawless, building the viewer's attachment to the characters as it unfolded to a marvelous finish; the acting was convincing; the music underscored every beat, making me want to use words like "themes" and "woven" and "tremendous" in ways that I am not familiar with.

I've said this before. There are teams that know Quality, and there is the majority of us, who don't. If everything was built the way Pixar builds movies... but no, most people contend themselves with doing a half-assed job.

On Saturday, after deciding with Kerz that we would make significant changes to our layout again — building the layout is by far the most fun part of having a layout at all — I took the train down to Maciej's party.

Some people argue that from Mountain View to San Francisco, you go "up", not "down". I beg to differ. Mountain View is where I am based, and therefore it's the top of the world, and therefore everywhere is "down" from Mountain View, and you always go back "up" to Mountain View. That's just how to is.

Many hours later the party wound down to a very metaphysical philosophical discussion in which is was posited that any statement stating facts about God(s) is trivially true, and wherein was asked the question "can an internally inconsistent system ever be useful?". (If you start with the assumption that 1=2, can you draw any useful conclusions?)

On Sunday I went to see San Francisco Opera's performance of Puccini's Madama Butterfly. It was a beautiful performance. The set, in particular, was stunning. I'm running out of suitably positive adjectives and therefore will avoid commenting on the music and the singers and the surprisingly expressive use of lighting, but they were all great too. (I ran into Steve Zilles during the intermission.)

I am often asked why I don't live in the city (meaning, San Francisco). I love San Francisco, but I couldn't live there. It's too noisy, dirty, wide; the roads are a mess; there are too many hills. Cities in the US (and I'm basing this on a ridiculously small sample, but bear with me) really seem to have a problem finding the aforementioned Quality. Trash bags piled high on the streets, dilapidated buildings standing next to art houses, graffiti in abundance, road surfaces which have more in common with Radiator Springs' high street after our hero ripped through it than with the smooth surface of freshly laid asphalt; overcommercialisation; rampant poverty: all of these "features" which would cause a European city's population to rise in uproar are accepted by American populations as if they were normal.

Also, San Francisco is cold. The sweater, which I had brought with me in case I went into an air-conditioned building, was my only source of insulation when I realised my 13°C mistake.

If I could comfortably afford it, I'd consider getting a second flat in the city to spend weekends, because it's true that there are more things going on in the city than elsewhere in the bay. But in the meantime, my home is where it's warm.

Although... I'm starting to like the reckless and near-suicidal adrenalin-pumping action adventure that is cycling in SF. You need omniscient awareness of the road and pavement and traffic and pedestrians; you need to be one with your bike, flying through gears as you alternately fly down through green lights and then screech to a halt at a red one, turn a bend and go up a sharp hill for a few blocks before suddenly finding yourself at the dizzying top of a descent that, weaving between parked cars and bii stopped at odd angles, you are about to negotiate.

The WHATWG list has been ablaze with talk of mathematics markup. I have not been taking part in the discussion much. I pointed out that reinventing mathematics markup is a bad idea when so many solutions have already been invented; I suggested that the idea that you could render the majority of mathematics using just CSS was probably a little optimistic; I explained that we could merge MathML into text/html HTML if we wanted to reuse MathML, which would probably be the easiest solution since MathML is already set up to work with the DOM and CSS and XML and namespaces; and I suggested some things we could do to make MathML markup simpler if we wanted to make it easier to author without sacrificing compatibility with MathML — but the other participants in the discussion mostly disagreed, it seems (sometimes emphatically, and not all in the same direction). I'm not sure where to go with this. There is no clear consensus as to what we should add to HTML5, if anything.

My current main focus with the XHTML5 spec right now is aligning it with the developments at the W3C, most notably Maciej's Window object specification. This is proving interesting, because it's not clear exactly how the two specs should mesh.