-
200805 Feb
Posted in News
If you’ve been reading this blog, you’ll know that Opera has been making great progress on the CSS3 selectors front in the latest version of its engine – Presto Core-2. While Opera 9.5 does pass every test in the CSS3.info selectors test, it wasn’t without issues. The test doesn’t test the
::selection
pseudo element. It also doesn’t test what happens when manipulating the markup through the DOM. Both of these were not supported in Core-2, but that is now not the case.If you go to this test page (Warning Geocities) with the latest Opera weekly, you’ll notice it is now working correctly. This is the last selector that Opera didn’t support. The dynamic behaviour of the selectors have also been fixed. If you head off to Quirksmode and try out either the :first-child and :last-child, :only-child, :first-line and :first-letter or the :empty tests, you’ll find that they all work. Although it is most likely not without bugs (what software is?), it seems Opera 9.5 will be the first browser that fully supports all selectors in CSS correctly. It could be that Konqueror has fixed the issues high-lighted on PPK’s blog, but I don’t have a copy to test. Leave a comment if that is the case. Konqueror does fantastically well even if it doesn’t support everything.
You can skip to the end and leave a response.
-
Comments
-
01.
Wolfman2000 says:Comment » February 5th, 2008 at 7:29 am
I just got Opera 9.5 build 4634 (Mac), and that test page didn’t seem to work right for me.
The test text wasn’t read, so I doubt :contains works right.
The disabled text in the forums wasn’t green, and :value wasn’t purple.
nth-of-type seems backwards. It was gray before black, not black before gray.Someone else please confirm.
-
02.
One of the tests is for :contains – is that still part of CSS3?
It seems to be missing from http://www.w3.org/TR/css3-selectors/, but I know it was in an earlier draft. It would be brilliant if it was in – the ability to do “conditional formatting”, as per MS Excel spreadsheets, would open up a whole new area on the web. (Plus things like “find on page”).
-
03.
wolfman: it works fine for me, and I know the bugs were fixed that enabled both features I described.
-
04.
What’s this :contains property? I find no info about it? Can you query the content of the element with it? Like the attribute selector?
Can anyone give examples of it’s syntax?
-
05.
I’m on Konqueror 4.0.1 (using KDE 4.0.1) and this is what I observe from the test:
– Contains works. The test text is red.
– The enabled test works. The text is italics and red.
– The disabled test kind of works. The form field is indeed disabled (grayed out background) and the text is not italics. The text color, however, is not green.
– The value test fails, apparently. The text color is not purple.
– Selection test fails. The text does not turn red.
– nth-child test passes, just like in Konqueror 3.5.8.
– nth-of-type child fails, apparently. The first image is stroked with a gray border and the second image has a black border, contrary to the description of the test.So it looks like KHTML has a little bit of work to do but based on its past record, I expect it to support these selectors and pseudo-classes very soon.
-
06.
I’ve just installed the latest weekly build for Windows, Opera 9.50b build 9770, and the :content selector on the test page linked in the article isn’t working.
-
07.
-
08.
:contains doesn’t suppose to work. It has been removed from the spec, so is irrelevant. ::selection is the property that has been added in Opera 9.5 and the dynamic behaviour of the other selectors.
-
09.
Is that temporarily or permanent? I see the CSS3 docs got a space for it, but it’s blank. http://www.w3.org/TR/2005/WD-css3-selectors-20051215/#content-selectors
-
10.
Maybe the W3C is worried about the number 666? ;)
-
11.
sentio says:Comment » February 7th, 2008 at 11:30 pm
David, why the test you mentioned works in Opera? IMO the test is invalid. It uses “:selection” not “::selection”. (http://www.w3.org/TR/css3-selectors/#UIfragments) It shouldn’t work in Opera, as it doesn’t work in Webkit. The proper test case is available on a page: http://www.quirksmode.org/css/selection.html
-
12.
the single : notation has always worked in Opera. I’m almost sure that notation also works in other browsers for psuedo elements that should have the double :: notation too.
-
13.
sentio says:Comment » February 8th, 2008 at 10:17 am
David, as I said above single : notation for ::selection does *not* work in Webkit.
-
14.
Robert Blaut says:Comment » February 14th, 2008 at 11:38 pm
Take a look at an impressive ::selection demo: http://taat.pl/typografia/eksperymenty/ilu/
-
15.
mabdul says:Comment » February 28th, 2008 at 1:14 am
Hey, thats a really cool example! that … i have no words *g*
-
01.