Patch(es) for supporting :lang pseudo-class in khtml
Thiago Macieira
thiago.macieira at kdemail.net
Sun Apr 11 05:26:39 BST 2004
Okay, so I wanted this on my site and Konqueror didn't support it. I got
a bit of free time and I decided to implement it on myself. After
fighting bison a bit, I got this to work:
- first of all, the : character is allowed in HTML attributes, so that
we get xml:lang recognised
- 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.
- in checkOneSelector, I've added the processing. It's a copy of the
hyphen-match code (the CSS2 specs say :lang is processed like
hyphen-match).
Missing: the FIXME in checkOneSelector. HTML <= 4 should use "lang"
only; XHTML 1.0 should use "xml:lang" and, if not found, "lang"; XHTML
1.1 should use "xml:lang" only. I opted to not distinguish and allow
xml:lang to override lang -- conforming documents won't have a problem.
I'm attaching the non-generated files to this e-mail. I can mail the
generated ones as well (htmlattrs.[ch], tokenizer.cpp, parser.cpp and
parser.h), but the patch is 144k in size.
--
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: 7169 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20040411/df2e8f55/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/df2e8f55/attachment.sig>
More information about the kfm-devel
mailing list