some fixes you might want in Safari and two questions
Lars Knoll
lars at trolltech.com
Thu Apr 17 19:29:26 CEST 2003
Hi,
I did merge the css/ changes you did in v68 into khtml today, giving us a
rather small delta in this directory (apart from the CSS namespace support I
added in our codebase, some smaller things and of course the diff to v73).
I noticed, that there are two crash fixes we made in khtml's css code, that
are still not part of Safari as far as I can tell. They are attached below.
I also noticed, that you allow "foo { color: 0000ff }" (without the required
hash) even in strict parsing mode, while you forbid "color: 123456". IMO the
first one should be forbidden aswell. (ie. in cssparser.cpp:parseColor allow
tokens of type DIMENSION only in non strict parsing mode).
Another thing I noticed is this diff in the css tokenizer (in v73):
{num}{ident} {yyTok = DIMEN; return yyTok;}
-{num}% {yyTok = PERCENTAGE; return yyTok;}
+{num}%+ {yyTok = PERCENTAGE; return yyTok;}
{num} {yyTok = NUMBER; return yyTok;}
Any reason for this? It breaks the CSS specs, and I can't see why it makes
sense to recognise "100%%%%%%%" as "100%".
If we need this for non strict mode (because all the others parse it as valid
CSS), then it would IMO be better to add another token BROKEN_PERCENTAGE to
the tokenizer:
{num}{ident} {yyTok = DIMEN; return yyTok;}
{num}% {yyTok = PERCENTAGE; return yyTok;}
+{num}%%+ {yyTok = BROKEN_PERCENTAGE; return yyTok;}
{num} {yyTok = NUMBER; return yyTok;}
and modify the parser to deal with these correctly in non strict mode (and
ignore these rules in strict).
Cheers,
Lars
-------------- next part --------------
A non-text attachment was scrubbed...
Name: parser.diff
Type: text/x-diff
Size: 966 bytes
Desc: not available
Url : http://mail.kde.org/mailman/private/khtml-devel/attachments/20030417/b2620512/parser.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cssstyleselector.diff
Type: text/x-diff
Size: 814 bytes
Desc: not available
Url : http://mail.kde.org/mailman/private/khtml-devel/attachments/20030417/b2620512/cssstyleselector.bin
More information about the Khtml-devel
mailing list