Showing posts with label firefox. Show all posts
Showing posts with label firefox. Show all posts

Wednesday, January 4, 2012

UPDATED: FireFox 9.0.1 Font CSS Bug Strictness

Today I got a nice surprise at work this morning. One of my teammates got the FireFox 9.0.1 (Windows) update pushed to them yesterday and it broke an internal mediawiki site. Thinking this must be a bug in the CSS of our mediawiki skin I dove into explore the issue. This is not my CSS code so I was naturally suspicious and couldn't wait to rub it in to another colleague (author of said CSS) when I found his hideously stupid bug....

Unfortunately I didn't get the opportunity to do a little chiding, because the problem, it turns out, is with the CSS parser in the FireFox 9.0.1 update. The CSS parser in FireFox 9.0.1 doesn't handle the font stack correctly.

Honestly that's being far too generous. This bug breaks font attributes in CSS, okay not all font attributes in CSS just the ones you want to override. It does NOT allow overriding of previous settings at ALL in the font attributes.

UPDATE: There was a helpful soul on the forum that gave me a gentle shove towards the CSS documentation found here and it illuminated the bug in the CSS below. While it worked in previous versions of FireFox, it probably shouldn't have. I've preserved the original example for others to see the issue. I've made the example a little more copy & paste friendly.

Take this BUGGY example:
<style>
#p-wrapper p {
font-family: arial;
font-size: 125%;
}

#p-inner p {
font-size: 95%;
}
</style>

<div class="p-wrapper"><p>Some Wrapper Text</p>
<div class="p-inner"><p>Some inner text</p></div>
</div>

What supposed used to happen with the above snippet is that the font-size would change from 125% when in the p-wrapper class(can you spot the bug yet?), unless you happen to be in the p-inner class(there's that word again) in which case the font-size should change to 95%. In FireFox 9.0.1 this does not happen. Instead the first value for font-size wins. There's no cascading at all. It really makes the CSS engine in FireFox 9.0.1 look more like SS. And that is to be expected. That code has a bug. The # at the beginning of p-wrapper and p-inner define an id selector. What I need is a class selector. FireFox 9.0 became strict in this respect and now you must actually write VALID CSS(what a concept) like the following:

<style>
.p-wrapper p {
font-family: arial;
font-size: 125%;
}

.p-inner p {
font-size: 95%;
}
</style>

<div class="p-wrapper"><p>Some Wrapper Text</p>
<div class="p-inner"><p>Some inner text</p></div>
</div>

There is still a CSS bug in FireFox 9, but it does not appear to be mine. My bug appears to be non-standard and almost flatly invalid CSS. The good thing to come out of this episode is that I now get to harass the colleague for the sloppy code. YAY!!! However, now I have to fix up the CSS in the mediawiki skin.... BOO!!!

If you find any mistakes or errors in this post please drop a note.

Happy Hacking!!

Monday, December 18, 2006

FOSS and The Devil

Well just to lay the groundwork for this essay and define "The Devil." It may not be what you think it is... It's not the warm, fuzzy and cuddly daemon mascot for the BSDs. It's Microsoft. Surprise!

Some of us have to live in the Windows world periodically and these are the tools that can make your life much easier in the world that is missing multiple desktops, grid snapping windows, vertical/horizontal maximize and requires you to reboot all the time due to patches.

Let's start with tools you need that do not come with the OS.

A single IM client to connect to all the IM services you use. GAIM works very well. Even the 2.0 beta is pretty nice and you can chat securely if needed using OTR or GAIM-encryption.

For CD-ripping you can use CDex. It supports the old standby mp3 as well as ogg and flac(the last two being open formats). This software is really straightforward and utilizes the free CD database, that way your CDs will rip with the correct artist and song title information.

Bittorrent? There is a nice Java app that is completely open called Azureus. I know it's open as I've been compiling it on Gentoo for a while. If Java doesn't seem open enough they are taking it GPL soon so that's pretty open.

Want to do image editing in XP? There is tool built-in, but it's not very good. Here's where the GIMP comes in handy. It's not the greatest tool, it certainly is not PhotoShop, but for 99% of the people touching up your photos or taking a good screenshot it's great. It also beats having to pirate a very expensive piece of software.

To do your word processing or spreadsheeting, it's hard to beat OpenOffice.org. The offering is complete. It's not a drop in replacement for Excel, but it will read the same documents and works really well for most people. I've used it to great success trying to read "The Devil's" file formats and in fact I haven't had to load any of "The Devil's" office programs to collaborate with my colleagues or customers. Now that there's been a 2.0 release and with the Open Document Format becoming an ISO standard this software is hard to beat.

Now for replacement programs.

To replace Internet Explorer there is the newly appointed champion of FOSS, FireFox. It's more secure and just works...well...almost everywhere. In the few places that it might not work correctly(they really are few and far between) there is always the extension IE Tab to get you over that hump. Even though I'm sure you've heard about FireFox, if you've never tried it then grab it, open it and press ctrl-t. Let me know what you think.

If you need to read your email then take a peek at ThunderBird. This app has gone through many changes since it split off of the main mozilla suite. It's now faster and better than it has ever been. In 1.5 you get a massive improvement in IMAP speed(if that's important to you) and the search has been improved greatly.

If you also happen to be a *nix geek like me then you might also try out another piece of software, cygwin. This will give you a *nix like terminal and most of what you would expect in a *nix command line, sed, awk, grep, etc... After you install cygwin, the icon generated will load up bash by default and you can even run an X server under it. I do this at work in replacement of a very expensive piece of software called exceed. How do they sell this software?

While we're talking about *nixy geeky software, how about we discuss everyone's favorite editor? I mean just raw text editing here. Things like shopping lists, call lists, meeting invites, todo lists, honey do lists, technical notes..... What? You use more sophisticated tools for this? Do you really need different fonts, decorations and formatting for these things? How did you get along before a computer? If you accomplish these text based tasks using ... OpenOffice then you should pick up GVim.

There are many other pieces of software I may have left off. If that's the case and I've missed your favorite FOSS software on Windows then drop a note in the comments.