Re: [libcroco-list] more on selectors



Heya stefan !

Well, it seems like you are really debugging the selection engine ;)
I have played with some selection test cases a lately and I have seen
your problem.

The problem is that in the current implementation, non element nodes
are significants and in particular, blank text nodes.

As an example, let consider the xml document (doc.xml):
============
<?xml version="1.0" ?>
<root><A/><B/></root>
======================

and the CSS stylesheet (doc.css)
==================
A + B {
  color: b-color ;
}
=================

The ruleset A + B {..} correctly selects the element <B/> of the
doc.xml.

But if you consider the xml document (doc.xml):
==================
<?xml version="1.0" ?>
<root><A/> <B/></root>
==================
(note the space between <A/> and <B/>)

The ruleset A + B {...} does not selects the element <B/> because 
the selection engine considers that the element B does not immediatly
follows element A.

And I think this is a bug. Because from what I understand from the
CSS2 spec, CSS2 selectors applies to element nodes only, unless a
special pseudo-class type selector comes into play.

I already have a patch for this on my source tree and I will commit it
soonish in the CVS HEAD.

As of the pseudo-class selection, yes some more code is needed to
handle them, even if not all of them will be easy to support.
Do not hesitate to ask if you want them to be supported. We will
start a discussion about it.

Thank you for your time and effort.

Dodji.

On Sat, Dec 13, 2003 at 11:59:45PM +0100, Dodji Seketeli wrote:
> > neither the '+' operator ('A + B' -> 'an A if followed by a B')
> > nor the ':first-child' pseudo-element appear to work.
> Oh, oops, my fault.
> Pseudo element and pseudo class selectors are usualy "dynamic".
> Are not evaluated today, eventhough there are parsed correctly.
> 
> But A + B type selectors should work. The test5 in the
> non regression test suite tests this case. You maybe came
> across a bug.
> 
> Could you please give me the test case you used ?
> 
> Thank you very much for your time.
> 
> Dodji.
> 
> > I just did a quick search in the code (the parser) bug
> > couldn't find any token for it.
> > 
> > Stefan
> > 
> > _______________________________________________
> > Libcroco-list mailing list
> > Libcroco-list gnome org
> > http://mail.gnome.org/mailman/listinfo/libcroco-list
> _______________________________________________
> Libcroco-list mailing list
> Libcroco-list gnome org
> http://mail.gnome.org/mailman/listinfo/libcroco-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]