Rule matching oddness with new CSS parser
Lars Knoll
khtml-devel@kde.org
Mon, 24 Feb 2003 08:19:09 +0100
You're right. Thanks for catching this one. I submitted it now to our CVS
aswell. I do however still see some problems with the CSS menues on meyerwebs
CSS/edge sites. Do they work correctly for you?
Lars
> Ok, this behavior exactly matches the old parser (and all my test cases
> finally pass, yay!).
>
> The old parser chains the sub-selectors inside simple selectors from
> left to right. It then hands back the leftmost subselector. This
> production matches that behavior:
>
> specifier_list specifier {
> $$ = $1;
> CSSSelector *end = $1;
> while( end->tagHistory )
> end = end->tagHistory;
> end->relation = CSSSelector::SubSelector;
> end->tagHistory = $2;
> }
>
> For complex selectors the old parser chained the simple selectors from
> right to left. The rightmost link in a simple selector would point to
> the leftmost link in the next simple selector. This production matches
> that behavior.
>
> selector combinator simple_selector {
> $$ = $3;
> CSSSelector *end = $3;
> while( end->tagHistory )
> end = end->tagHistory;
> end->relation = $2;
> end->tagHistory = $1;
> }
>
> dave
> (hyatt@apple.com)
>
> _______________________________________________
> Khtml-devel@mail.kde.org
> http://mail.kde.org/mailman/listinfo/khtml-devel