Johannes wrote:
On Wed, Feb 11, 2009 at 06:03:13PM +0000, corvid wrote:
I tried font-size: .6in (we still love archaic measurements here) and it didn't work.
The grammar says num [0-9]+|[0-9]*"."[0-9]+
Oh yes. That's Css_next_token() which is not recognizing ".6" as a float...
Attached. I'm too much of a css newbie to promise great testing, but I did cobble together the following and the right things seemed to happen: <html> <head> <style type="text/css"> hr.aaaaa {width: 1.5in} bbbbb {width: 2 in} </style> </head> <body> <hr style="width: 0.3in"> <hr style="width: .6in"> <hr style="width: 1 in"> <hr class="aaaaa"> <hr class="bbbbb"> </body </html>
On Thu, Feb 19, 2009 at 12:30:34AM +0000, corvid wrote:
Johannes wrote:
On Wed, Feb 11, 2009 at 06:03:13PM +0000, corvid wrote:
I tried font-size: .6in (we still love archaic measurements here) and it didn't work.
The grammar says num [0-9]+|[0-9]*"."[0-9]+
Oh yes. That's Css_next_token() which is not recognizing ".6" as a float...
Attached.
I'm too much of a css newbie to promise great testing, but I did cobble together the following and the right things seemed to happen:
<html> <head> <style type="text/css"> hr.aaaaa {width: 1.5in} bbbbb {width: 2 in} </style> </head> <body> <hr style="width: 0.3in"> <hr style="width: .6in"> <hr style="width: 1 in"> <hr class="aaaaa"> <hr class="bbbbb"> </body </html>
Looks good to me so far. The only thing I'm wooried about is the hack where Css_parse_simple_selector() checks for CSS_TK_FLOAT and interprets them as class selectors. After looking at the CSS syntax I think this is not necessary, as class names must not start with numbers. Can you please have look at the spec too, to confirm this? In that case we could just remove the hack in Css_parse_simple_selector(). Cheers, Johannes
Johannes wrote:
On Thu, Feb 19, 2009 at 12:30:34AM +0000, corvid wrote:
Johannes wrote:
On Wed, Feb 11, 2009 at 06:03:13PM +0000, corvid wrote:
I tried font-size: .6in (we still love archaic measurements here) and it didn't work.
The grammar says num [0-9]+|[0-9]*"."[0-9]+
Oh yes. That's Css_next_token() which is not recognizing ".6" as a float...
Attached.
Looks good to me so far. The only thing I'm wooried about is the hack where Css_parse_simple_selector() checks for CSS_TK_FLOAT and interprets them as class selectors. After looking at the CSS syntax I think this is not necessary, as class names must not start with numbers. Can you please have look at the spec too, to confirm this? In that case we could just remove the hack in Css_parse_simple_selector().
I did happen to see: In CSS1, a class name could start with a digit (".55ft"), unless it was a dimension (".55in"). In CSS2, such classes are parsed as unknown dimensions (to allow for future additions of new units). To make ".55ft" a valid class, CSS2 requires the first digit to be escaped (".\35 5ft")
On Thu, Feb 19, 2009 at 03:32:54PM +0000, corvid wrote:
Johannes wrote:
On Thu, Feb 19, 2009 at 12:30:34AM +0000, corvid wrote:
Johannes wrote:
On Wed, Feb 11, 2009 at 06:03:13PM +0000, corvid wrote:
I tried font-size: .6in (we still love archaic measurements here) and it didn't work.
The grammar says num [0-9]+|[0-9]*"."[0-9]+
Oh yes. That's Css_next_token() which is not recognizing ".6" as a float...
Attached.
Looks good to me so far. The only thing I'm wooried about is the hack where Css_parse_simple_selector() checks for CSS_TK_FLOAT and interprets them as class selectors. After looking at the CSS syntax I think this is not necessary, as class names must not start with numbers. Can you please have look at the spec too, to confirm this? In that case we could just remove the hack in Css_parse_simple_selector().
I did happen to see: In CSS1, a class name could start with a digit (".55ft"), unless it was a dimension (".55in"). In CSS2, such classes are parsed as unknown dimensions (to allow for future additions of new units). To make ".55ft" a valid class, CSS2 requires the first digit to be escaped (".\35 5ft")
Ah ok. That explains the current implementation. For CSS 2.1 must not support class selectors like '.1'. http://www.w3.org/Style/CSS/Test/CSS2.1/current/html4/by-section.htm has some nice test cases on this subject. I also noticed, that we need to discard the whole ruleset in case of an invalid selector. Cheers, Johannes PS: I haven't looked at escaped chars at all yet. There seems to be some code for it in cssparser.cc.
On Thu, Feb 19, 2009 at 12:30:34AM +0000, corvid wrote:
Johannes wrote:
On Wed, Feb 11, 2009 at 06:03:13PM +0000, corvid wrote:
I tried font-size: .6in (we still love archaic measurements here) and it didn't work.
The grammar says num [0-9]+|[0-9]*"."[0-9]+
Oh yes. That's Css_next_token() which is not recognizing ".6" as a float...
Attached.
I'm too much of a css newbie to promise great testing, but I did cobble together the following and the right things seemed to happen:
<html> <head> <style type="text/css"> hr.aaaaa {width: 1.5in} bbbbb {width: 2 in} </style> </head> <body> <hr style="width: 0.3in"> <hr style="width: .6in"> <hr style="width: 1 in"> <hr class="aaaaa"> <hr class="bbbbb"> </body </html>
Committed. I hoped to be able to make that code a bit shorter, but could not find a reasonable solution... Cheers, Johannes
participants (2)
-
corvid@lavabit.com
-
Johannes.Hofmann@gmx.de