[PATCH] New attempt at CSS3-function arguments

Thiago Macieira thiago.macieira at kdemail.net
Sun Apr 11 20:41:41 BST 2004


Hello, 

I'm attaching again a new patch to handle CSS2 and 3 function arguments 
for pseudoclasses.

It's not complete, but it's working for what is implemented 
already: :not and :lang, as well as some future numeric values.

Differences from the last patch:
- instead of single-casing :lang, I have now single-cased :not. If you 
take a look at the CSS3 working draft
	http://www.w3.org/TR/2001/CR-css3-selectors-20011113/#grammar
you'll see they place "negation" in "simple_selector_sequence", but 
"negation_arg" can't have it. So, based on that, I believe :not is 
special and could be separated

- therefore, :lang is now a normal-case. The possible arguments for one 
"normal" function can be a string, an identifier, a number or an "an+b" 
expression.

- strings, identifiers and numbers (signed integers and unsigned floats) 
are being parsed correctly

Missing:
- parsing of expressions containing 'n': it's not working at all
- signed floating-point: it's not working and I don't know why

Currently, khtml does not implement :nth-child() and similars, so the 
expression parsing is not yet needed.

Note: the CSS3 grammar says expressions 'n' and '-n' are valid. However, 
parsing those expressions into a=1, b=0 would make it impossible to 
have an identifier called 'n' or '-n', so I'd let the checkOneSelector 
function recognise those two possible strings -- it'll have to do so 
for "odd" (a=2,b=1) and "even" (a=2,b=0) anyways. That's how it's 
working now.

-- 
  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: non-generated.diff
Type: text/x-diff
Size: 12117 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20040411/c49bf675/attachment.diff>
-------------- 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/c49bf675/attachment.sig>


More information about the kfm-devel mailing list