Patch(es) for supporting :lang pseudo-class in khtml

Thiago Macieira thiago.macieira at kdemail.net
Sun Apr 11 06:48:10 BST 2004


Thiago Macieira wrote:
>- then, the parser and tokenizer need to be updated in order to get
> the proper value loaded. The current parser can read :not() fine, but
> it expects a simple-selector inside the parentheses. :lang() has a
> string in there, unquoted: IDENT seemed to be the best.

Updating myself. From http://www.w3.org/TR/REC-CSS2/grammar.html#q1:

pseudo
  : ':' [ IDENT | FUNCTION S* IDENT S* ')' ]
  ;

Whereas our parser.y (simplifiedly) has:
pseudo:
    ':' IDENT
    |
    ':' ':' IDENT 
    | ':' FUNCTION maybe_space simple_selector ')' 
  ;

If we changed the 'simple_selector' above to IDENT, it would turn the 
declaration to what I had come up with [ ':' LANG maybe_space IDENT 
')' ], but it would impose that certain functions (namely, :not) parse 
further.

I think that would clobber the grammar much less, but I have no little 
idea how to parse the identifier. It seems that extending the grammar 
is necessary anyhow.

Either way, I am misusing the CSSSelector::simpleSelector field to store 
the identifier.

BTW: my rule is broken. It requires a maybe_space after IDENT. I'll 
correct my local patch, but I won't send another e-mail with it yet.
-- 
  Thiago Macieira  -  Registered Linux user #65028
   thiago (AT) macieira (DOT) info
    ICQ UIN: 1967141   PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20040411/3c8f89cb/attachment.sig>


More information about the kfm-devel mailing list