IE7’s CSS breaking “content: counter” bug

I came across a peculiar bug today while testing theiconic.com.au in IE7;

#foo:before {
    content: counter(item, ".") ": ";
}

Completely breaks IE7’s CSS parser for the current .css file.

The fix, as explained in pragmar’s answer on SO, is to add a space after ‘item’. This is not the most optimal fix, and has the potential to break when minifying.

The fix is to remove the space between the comma and the open quote. This is also safe for minification:

#foo:before {
    /* Note removing the space after ',' fixes IE7's CSS parser */
    content: counter(item,".") ": ";
}

This only occurs when using a quoted counter list-style-type. Using ‘open-quote’, ‘close-quote’, etc, does not exhibit the bug.

Check out the example below for a practical demonstration across browsers.

Example: IE7’s CSS breaking content counter bug.

ie7-content-bug

Happy Coding!

Tagged , , ,

CyanogenMod 10.1 bootloop fix

Update (2013-07-22): The libskia.so file location has been updated. You can now download it from here

After updating my Samsung Galaxy S2 (SGSII, GT-I9100) to the latest CyanogenMod 10.1 nightly (20130228), I got stuck in a boot loop where it would constantly show the CyanogenMod boot logo spinning!

After some searching, I came across this post in the nightlies forum of xda developers.

So, without further ado – let’s get to fixing this bootloop!
Continue reading

Installing mojito on Ubuntu 12.10

Installing Mojito should be a simple task using Ubuntu’s Package manager…

Install the required node and npm dependancies
$ sudo apt-get install nodejs nodejs-dev nodejs-legacy npm

Update npm:
$ sudo npm install -g npm

Clear npm cache:
$ sudo npm clear cache

Install Mojito:
$ sudo npm install mojito -g
Continue reading

SoundWave 2013 Sydney Timetable Calendars

I have put together some public calendars which contain the timetables of each stage for SoundWave 2013 at Olympic Park, Sydney on 24th February.

Simply click the below links for your calendar software, or view it directly online:
Continue reading

Tagged , ,

The Visitor Pattern in PHP

Implementing the Visitor Pattern requires the ability to dynamically determine the type of the Visitor and the type of the “Element” (aka: object receiving the visitor).

In PHP (>= 5.0.0), this can easily be achieved with the get_class() function as we will see shortly.

Let’s start by looking at how the Visitor Pattern will look within user code;

$updateVisitor = new UpdateVisitor();
$deleteVisitor = new DeleteVisitor();
$element = new Foo();

$element->visit($updateVisitor);
$element->visit($deleteVisitor);

Looking at the UpdateVisitor class, we want the visitFoo() function to be called;

interface Visitor { }
class UpdateVisitor implements Visitor {
    public function visitFoo(Foo $theElement) {
        // ...
    }
}

You may already be (correctly) thinking “Why not just call $updateVisitor->visitFoo($element) directly?”.
Continue reading

Tagged , , ,