Safari CSS class-name substring parsing bug

When rendered correctly, the text of all three list-items below should be red on a green background. Furthermore, the word "list-item" should be rendered in uppercase.

Safari v1.0 fails to apply these CSS styles to item number 3 because it has more two class names - "firedream" and "red" - and the second name is found as a substring within the first one and thus ignored altogether.

This bug conflicts badly with the CSS whitespace parsing bug in IE5/Mac.


  1. This list-item has class="red"
  2. This list-item has class="red firedream"
  3. This list-item has class="firedream red"

The CSS:

.red {
  color : red;
  background-color : #9e9; 
}
.firedream {
  font-style : italic;
}
.red span {
  text-transform : uppercase; 
}

See also the related weblog entry.


Már Örlygsson - mar@anomy.net - http://mar.anomy.net/