Little-known fact

January 29th, 2006

Chuck Norris can dereference a NULL nsCOMPtr.

Stylish

January 15th, 2006

Stylish, a Firefox extension by Jason Barnabe, lets you manage CSS rules to change the appearance of web sites.

Stylish is to CSS what Greasemonkey is to JavaScript. Stylish allows you to easily manage user styles for the application UI, all websites, or only certain websites. Stylish is better than using userChrome.css/userContent.css because styles are applied immediately instead of requiring a restart.

Some Greasemonkey scripts only add stylesheets. These scripts would work better as user stylesheet additions, because user style rules are applied immediately rather than only after the page finishes loading. Stylish makes it as easy to add a user stylesheet as it is to install Greasemonkey scripts.

You can use it with pre-written user style rules such as my examples or you can write your own as you use the extension. The test styles bookmarklet, which lets you experiment with added CSS rules, complements Stylish well.

Update 2005-02-11: Updated link to point to userstyles.org/stylish instead of the extension's forum thread.

“If you buy me a Mac” returns

January 15th, 2006
<morgamic> holy crap
<morgamic> you guys have been busy
<morgamic> nice work!
<Lupine1647> Now we just need a Mac to get some of those themes reviewed, heh.
<gavin> If you buy me a MacBook Pro I'll do it.

"If you buy me a Mac" is somewhat of a running joke in the Mozilla community, but I hadn't heard it for a while. Apple must have done something right with the MacBook Pro.

Firefox memory leak detection tool

January 13th, 2006

David Baron recently wrote a tool that testers can use to help reduce memory leaks in Firefox. With this tool, you can find out what leaks you encounter during your normal browsing patterns and report useful bugs when you encounter leaks.

It detects many large leaks even though it only tracks three types of objects (documents, docshells, and domwindows) because many large leaks entrain at least one of those objects. It tries to report the URLs associated with the leaks it detects, allowing you to go back and figure out the steps needed to reproduce the bug.

I have found three leaks so far with this tool. David Baron has already fixed one of them on the trunk.

To use leak-gauge.pl, you need a version of Firefox with the logging code, such as a recent trunk nightly build. If you're using Windows, you'll also need to download Perl. leak-gauge.pl contains instructions for making Firefox log the required information and for running leak-gauge.pl to analyze the log.

Update 2006-01-14: There's also a JavaScript version, which might be easier to use if you use Windows and don't have Perl.

Further reading:

Amazon botches unicode gift note

December 30th, 2005

While ordering a gift for my girlfriend through Amazon, I included a music symbol () and a heart symbol () in the gift note. The printed gift note that Amazon shipped with the gift showed "&#9835;" and "&#9829;" where the symbols were supposed to be. Amazon's confirmation page had showed the symbols correctly.

Acid2 in Gecko

December 24th, 2005

The MozillaZine article discussing the draft branch plan for Gecko 1.8.1/1.9 and Firefox 2/3 contained an interesting thread about the Acid 2 test.

The draft plan discourages changes affecting web content on the branch for Gecko 1.8.1 / Firefox 2, preferring to leave those changes in the trunk, which will become Gecko 1.9 / Firefox 3 and future versions.

MillenniumX started the thread by asking:

"Does this mean that Firefox users will be waiting until 2007 for Acid2?".

Gecko developer Boris Zbarsky explained why Acid 2 fixes seem to be coming slowly:

Acid2 got released at the worst possible time for Gecko development -- right in the middle of a beta cycle. Since fixing all the Acid2 bugs requires fundamental architecture work, that meant that to fix them Gecko had to finish the beta cycle, ship a 1.8 final, then start taking the fixes for Acid2 stuff.

And such fixes are happening. The <object> loading rewrite fixed most of the issues; the painting rewrite fixes more, and the reflow rewrite will fix the rest once it's done. But given how testing happens and how fragile most web content is, the first of these three changes probably needs 2-3 months of testing before it could possibly be shippable in stable form; the other two need more; I'd estimate 4-5 months of testing (and the reflow rewrite is not close to being finished yet). All of which means that targeting 2007 Q1 is about as well as could be done; figure another 2-3 months from now to finish the work, then 4-5 months to test, that puts us at end of 2006 for actually shipping. And that assumes that nothing else gets worked on but Acid2 issues.

My favorite comment came from jilles:

Nobody is really waiting for it. Really, there are easier ways to display smileys.

See also:

Microsoft patches UI race condition holes in IE

December 22nd, 2005

Microsoft has finally fixed some UI race condition holes in Internet Explorer. I think the holes they just fixed include some of the holes I first reported to them in March 2004 and posted to Full Disclosure in July 2004, and which were known the whole time to allow e.g. spyware installation.

Microsoft's fix involves disabling the "Run" button for about a second. One interesting difference between Microsoft's fix and Mozilla's fix is that Internet Explorer doesn't make the button visibly disabled; instead, it makes the button ignore clicks and keypresses for a short period of time. This works well given Microsoft's short timeout of 1 second (compared to Firefox's 2-3 seconds, which might be overkill).

Merry Holidays

December 22nd, 2005

Fox News may have a point with its "War on Christmas" meme. It's hard to explain a paragraph I saw while ordering a gift for my girlfriend through Amazon:

Jesse Ruderman, some of your items will arrive after December 24, 2005. If you haven't already selected faster shipping options, doing so might help get your items there in time for the holidays.

Fox is missing the big picture, though. The use of the phrase "the holidays" instead of the word "Christmas" is the least of the threats against Christmas. Some of the larger threats:

  • Christmas muzac. Every Christmas song has been made into a hundred boring versions, which department stores, supermarkets, and airports play exclusively for about a month leading up to Christmas Day.
  • Hanukkah Bushes disguised as Christmas trees. (The giveaway is usually the Star of David at the top.)
  • In Switzerland, kids can no longer sit on Santa's lap at the mall due to fears of pedophilia.
  • Consumerist gift-giving distracts us from other aspects of Christmas and may be an overall deadweight loss.
  • Many parents tell their kids that Santa is real, causing all kinds of problems when they find out he isn't.
  • One can no longer wish people "Happy Holidays", "Season's Greetings", or "Merry Christmas" without offending someone and taking a side in a pointless acrimonious debate.