Firefox.Opera.Opera Watch posted an interview with Firefox co-founder Blake Ross yesterday, in which he talks about Firefox, Opera, and the relationship between the two. When asked about the rivalry between fans of the browsers, he says, “I think it’s ridiculous. Millions of people out there rely on us to make the Web better, not have pissing contests.” I couldn’t agree more. In fact, I launched The Alternative Browser Alliance primarily in response to that rivalry.

I found it interesting that when asked to describe Opera in three words, Ross’ response was: “Our best ally.”

When web designers switch from focusing on a single browser (usually Internet Explorer) to developing cross-browser sites (usually adding Firefox, sometimes Opera or Safari, ideally all three), they often find that things don’t work as expected in the “new” browser. This can be for a number of reasons, including:

  • Bugs or “missing” features in the new browser (whether incomplete support in the new browser, or proprietary features in the familiar browser).
  • Broken code on the website being handled differently.
  • Different defaults where behavior isn’t well-defined in the specifications.

A big problem is that when you get into the code, a lot of pages aren’t as specific as the authors think they are. When you write code and test it on one browser, you’re not testing that the code is correct, you’re testing that that browser makes the same assumptions you do.

It’s like ordering pizza.

No, really. Let’s say Internet Explorer specializes in Chicago-style pizza, with a thick, chewy crust. And let’s say Firefox specializes in New York-style pizza, with a thin crust. But each can make the other style of pizza on request.

So you call up Internet Explorer and ask for pizza. They deliver you Chicago pizza, and if that’s what you wanted, you figure your order is fine. If you actually wanted New York style, you make sure that next time, you tell them you want that style of pizza.

But let’s say you like Chicago pizza. You get used to calling up IE and just asking for “pizza,” until one day you’re busy, and ask your roommate to order it. He likes to get his pizza from Firefox, so he calls them up, asks for “pizza,” and you get New York style. That’s not what you wanted. Obviously, Firefox pizza is inferior, because they got the order wrong! Well, no, it’s not, and no, they didn’t. They delivered what they were asked for. If you’d told your roommate to ask for Chicago style, Firefox would have been perfectly happy to deliver that style of pizza.

The moral of the story: always be specific with your code. Make sure it’s asking for what you think it’s asking for (validation helps here). And if something doesn’t do what you expect, make sure you didn’t leave that expectation out of your order.

See also: No, Internet Explorer did not handle it properly

(Expanded from a comment I posted at Mozillazine.)

From time to time the idea is put forth that Opera (and Firefox, for that matter) needs to start dealing with bad code. There are two problems with that view:

  1. Opera already deals with quite a bit of “bad code” (but there’s always room for improvement)
  2. Just dealing with bad code isn’t enough: you have to deal with it the same way someone else does.

#2 is the tough part.

The rules for dealing with good code are, for the most part, specific. If you encounter well-formed HTML, you can be reasonably sure you know what the author meant. But there are very few rules for dealing with bad code. Trying to "deal with it" means trying to guess what the author meant, and sometimes different assumptions are equally as likely.

Example:


<p><b>Here's some text</i> and here's some more.</p>

Did the author close the non-existent italics by mistake, meaning to close the bold? Or did he open bold by mistake, intending to open italics? Or is the closing italics tag left over from copy-and-paste? Depending on what assumptions the browser makes, it should display it as:

Here’s some text and here’s some more.

Here’s some text and here’s some more.

Here’s some text and here’s some more.

And that’s just a simple example. It gets wilder when you throw in issues like inline vs. block elements. A paragraph should never appear inside a tag for text formatting, like bold or italic. By all rights, starting a new paragraph (or more precisely, ending the previous one) should also revert to plain formatting. But a lot of old pages expect the formatting to continue into the next paragraph, because way back when, a P tag was a double-line break, not a container.

Now, suppose that Browser A always makes the first assumption, and Browser B always makes the second. If someone tests their code in Browser A, and it happens to be what they want it to do, they won’t necessarily notice that their code is broken. The result: the site looks wrong in Browser B, and the page author — who thinks the page is fine, since he tested it in Browser A — blames Browser B.

Multiply that scenario by millions of pages and you have a large chunk of the web as we know it today.

So the solution isn’t just to “handle bad code.” It’s to handle that bad code in the same way that the dominant browser handles it. And since there’s no document you can look to for guidance, that means taking every possible chunk of bad code, running it through the other browser, and seeing what it does to it.

And there are a lot of ways to break code!

Even Microsoft did this back when IE was new. At the time, lots of people were writing broken code and testing it by seeing whether it looked right in Netscape. So IE had to make the same assumptions Netscape did on certain things. Once IE became established, they diverged.

Some relevant articles:

This post originally appeared on Confessions of a Web Developer, my blog at the My Opera community. Minor updates are on my Tech Tips site.

Opera BrowserIn an interview at Opera Watch last week, Opera CEO Jon von Tetzchner responded to the eternal question: with less than 1% of global marketshare, why should web developers make the effort to support Opera? His response demonstrates another perspective on the numbers:

I believe we have something like 10 – 15 million active desktop users. That is actually quite a lot of people.

If you try to think about it, the place that I’m come from is Iceland. I was born in Iceland, that’s three hundred thousand people – we have a lot more. The place I live is Norway – we have a lot more. Actually if you look at it, the US has about 300 million people that live here, 50 states, about 6 million in each state on average. So which states have people that you would like to ignore?

He goes on to add that Opera Mobile is installed on 40 million mobile phones, with an additional 7 million people actually using Opera Mini. And then there are devices like the Nintendo DS and Wii…

Going by 2005 numbers, only four states have 15 million people or more: California (36M), Texas (23M), New York (19M), and Florida (18M). So take the 10–15M desktop users, the 7M Opera Mini users, and even 10% of the 40M mobile install base, and you’re looking at 21–26 million—the equivalent of the population of Texas.

Put that way, it doesn’t seem so small.

If you’re already supporting Firefox, in most cases the changes to support Opera 9 are minimal. The recently-launched Opera Developer Community has has tools, articles, and other resources to help build cross-platform sites.

Unless, of course, you don’t mind writing off a potential audience the size of Texas.

Firefox.Opera.Internet Explorer.

Microsoft will be releasing the long-overdue Internet Explorer 7 any day now (possibly as soon as Wednesday, if rumors prove correct). It will only be available for Windows XP SP2, Windows Server 2003, and the upcoming Windows Vista.

I know there are people out there still using Windows 2000, Windows 98, Windows Me, and other older systems that won’t run IE7. Why not take the opportunity to check out something new? Firefox 2 is also due out this month, and Opera 9 just came out this summer.

Despite what you may have heard, the vast majority of websites really do work on all major browsers. And with alternative browsers gaining popularity, the number of websites that block anyone but Internet Explorer is shrinking.

Opera and Firefox will bring you tabbed browsing, RSS Feeds, security and privacy controls, built-in searching, pop-up blocking—all the advantages IE7 boasts over IE6. Plus you get more customization, built-in spell checking, download management, session saving, and support for up-and-coming web technologies like SVG graphics and WebForms 2. Opera adds blazing fast display, voice commands and mouse gestures (leave that keyboard behind!), and per-site preferences.

Check out Opera. Check out Firefox. Or check out a dozen other alternative web browsers. Try them out, and see what works best for you.