Slightly ajar

Kestrel implementation report: CSS Snapshot 2007

, , , , ,

The W3C has just recently published a working draft of their first annual CSS snapshot. As this came about in a meeting in Beijing, I'll name it the Beijing report. Peter just beat me to the punch in covering what is included in the Beijing report on the CSS3.info website, so I'll let you read his post for an overview of what is in the draft. I personally think that this is a great step forward from the W3C, and is a sign that they are listening to criticism that CSS3 is taking too long. Having a snapshot like this allows user agent vendors, such as ourselves, to know what modules, or properties are considered stable enough to implement, without too much worry that the specs will change significantly.

We'd all love to see many of the things in the Backgrounds & Borders module, but this is not considered stable enough to be included in the snapshot, nor any property from the module. Looking at properties such as border-radius where more than one rendering engine supports supports it, they do differ in syntax and implementation. Opera does implement background-size as -o-background-size as it was needed for the UI of a certain customer delivery, and it was best to use an experimental implementation of a CSS3 property than invent our own vendor specific property.

Of the contents of the working draft, how far is Opera along in supporting these modules and specs? Using the latest public weekly of Kestrel as the subject, I've gone through the draft and noted what is and isn't supported.

CSS Level 2, Revision 1

This spec has been a long time coming and draws ever closer to completion. The spec is too large to cover everything that is supported in detail here, but if you take a loo at Opera Merlin's (9.0 - < 9.5) official spec sheet, you'll notice that Opera supports all of CSS2.1 with the exception of the visibility: collapse and white-space: pre-line property values. Since Merlin, Kestrel has added white-space: pre-line support. This can be tested at PPK's Quirksmode site. The spec has been updated recently, so I'm not sure if that information still holds true, so if anyone knows differently then please let me know. I couldn't find a changelog detailing what the recent changes were when it moved to Candidate Recommendation in July. Even if we only lack one value of one property, we still have bugs that have to be ironed out. The last I checked the test suite also had bugs. I would assume that Opera Kestrel currently has the most complete CSS2.1 support.

CSS Selectors Level 3

I've already wrote a lot about selectors on this blog, so regular readers will know that we pass all tests on the css3.info selectors test. The tests are not exhaustive, so there will be bugs, but it gives a good indication of what we support. It reports that we support all CSS selectors. This isn't quite true as it doesn't test the ::selection selector. That is the only selector that Kestrel doesn't currently fully support. Just like our CSS2.1 support, Opera has first class support for this spec, and is close to completion, apart from the seemingly never ending bug squashing that is a familiar part of any software development.

CSS Namespaces

CSS Namespaces allow is most useful in XML documents, and allows ocuments with mixed namespaces to be styled individually. For example, a p element in one namespace can be styled, without the p elements in another namespace being effected. If you declare the namespace @namespace xhtml "http://www.w3.org/1999/xhtml"; you could style only the p elements in this namespace using xhtml|p.

Opera already supported CSS3 Namespaces in Merlin, and it is now supported in other browsers such as Safari and Firefox. There are five testcases for namespaces in CSS found here, of which Kestrel currently fails one.

CSS Colour Level 3

Of all the specs and modules in this draft, the colour module is the least supported by Kestrel. We clearly support the colour properties for CSS2.1, but what about the extra properties and values in level 3? SVG colour keywords are supported, and in reality these have been supported by browsers for a long time, and just were not included in a spec. The opacity property was much requested and was included in Merlin. The currentColor value is also supported and I believe this was added in Kestrel. The HSL colour model isn't supported yet, but shouldn't be hugely difficult to support, given that it maps to RGB. An alpha channel has been added to both RGB and HSL an these are both not supported yet. This differs from opacity in that it is only applied to the property it is used on, such as the background-color and not the whole element. This will mean that the text will not be effected in this example. ICC Colour Profiles are also not supported as far as I'm aware, and neither is the flavor colour keyword. David Baron has written some testcases (thanks to fantasai for pointing that out) an not surprisingly Kestrel fails most of the HSL, HSLA and RGBA tests. Strangely it also fails the HTML colour keywords and SVG colour keywords tests and I'm not sure why. Safari and Firefox also both fail these tests. We also fail the flavour test, but I can't think of a single use case for the flavor colour keyword.

Overall Kestrel is in good shape in regards to supporting the standards in this snapshot, and has either the best support or close to it for each module listed, except perhaps the Colour module. Each of these have limited features missing, and except for the continuous cycle of bug fixing they are close to completion.

Tommy Rocks OperaGet your ethical t-shirt blanks from Edun Live

Comments

Alexis DeveriaFyrd Monday, October 22, 2007 12:30:29 PM

Thanks for the update! Very helpful.

Apparently the reason that the color keyword tests don't work is because table rows aren't displayed when all its cells are empty. Don't know the details on whether or not that's the correct behaviour, but that's what all browsers do. Surely the author would know of that though?

Here's a version of the SVG colors page with some text in each cell to make them appear. Indeed, Opera, Firefox and Safari seem to support the color keywords.

IE6/7 get all colors right, except the "grey" alternatives (that's gotta hurt, David) although "lightgrey" does work! How odd.

Steve DarkenDarken Monday, October 22, 2007 4:52:11 PM

Originally posted by Fyrd:

Thanks for the update! Very helpful.


+1 Very helpful, thanks.

Duncan Lockdflock Monday, October 22, 2007 11:54:53 PM

Nice post, thanks!
It would be really sweet to see RGBA support in Opera - this would be really cool - it's a more useful property than opacity, imho.

David Anderssonliorean Tuesday, October 23, 2007 6:22:07 PM

Fyrd: About gray/grey, lightgrey/lightgray - that's what you get when you borrow colour names from *NIX projects...

Unregistered user Thursday, October 25, 2007 6:08:56 PM

fantasai writes: I've fixed the tests you mentioned. The build scripts were discarding all the named character entities, see http://lists.w3.org/Archives/Public/public-css-testsuite/2007Oct/0022.html Please report future errors to the public-css-testsuite mailing list, thanks~ :)

Write a comment

New comments have been disabled for this post.

May 2013
S M T W T F S
April 2013June 2013
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31