[patch] Support for CSS Level 2 :lang pseudo-function
Thiago Macieira
thiago.macieira at kdemail.net
Sat Jul 3 20:58:31 BST 2004
Hello,
while Konqueror is supporting some Level 3 constructs, its Level 2
support is not complete. Among the missing ones is the :lang modifier
(see http://www.w3.org/TR/REC-CSS2/selector.html#lang)
In any event, I had come up with patches to do that a while ago, but
they were somewhat buggy. Here's another attempt:
css/css_base.h: add an "arg" argument that can be used by all CSS
pseudo-function modifiers, including the existing :not()
css/parser.y, css/cssparser.cpp and css/tokenizer.flex: make :not the
special case, instead of the rule. Allow parsing of other parameters
that aren't simpleSelectors.
css/cssstyleselector.cpp: adds the code for interpretation of :lang and
modify :not to use the new argument construct.
Bugs: this is NOT XHTML compliant since KHTML does not parse the
"xml:lang" attribute. If I modify misc/htmlattrs.in, add it and remove
the #if 0 from cssstyleselector.cpp, it also starts working, but it's
still not fully compliant (see the FIXME in the file).
However, since my gperf seems to be broken (it generates an inverse
lookup table that points every attribute Id to "http-equiv"), I cannot
test it. Besides, adding support for "xml:lang" right inside the
standard HTML attributes is a hack. KHTML should be able to parse the
xml: namespace on its own.
Attached is also a test file. You should see the second (and third for
"xml:lang") paragraphs be yellow with this patch.
--
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 --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20040703/98832655/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: khtml-:lang.diff
Type: text/x-diff
Size: 10970 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20040703/98832655/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/20040703/98832655/attachment.sig>
More information about the kfm-devel
mailing list