Skip Menu |

This queue is for tickets about the CSS-SAC CPAN distribution.

Report information
The Basics
Id: 5187
Status: open
Priority: 0/
Queue: CSS-SAC

People
Owner: Nobody in particular
Requestors: ville.skytta [...] iki.fi
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.05
Fixed in: (no value)



Subject: "Function" parsing broken
"Function" parsing is broken in 0.05, eg. the following trivial CSS: body { background-image: url(foo.png); } ...results in no "property" event being generated, and a warning: [warning] Unknown token in style declaration (line 1166) at [...] line 1375
From: Rene Saarsoo
I have pached this problem with the following code inside function CSS::SAC::parse_property_value by replacing the condition "elsif ($$css =~ s/^($RE_IDENT)\(//) {" and its contents with the following: elsif ($$css =~ s/^($RE_IDENT)\(//) { # cleanup the func and args # $text = lc $text; # $value =~ s/^\(\s*//; # $value =~ s/\s*\)$//; # $value =~ s/^(?:"|')//; #" # $value =~ s/(?:"|')$//; #" $text = lc $1; # if rgb function, which doesn't contain string # like url(http://example.com/image.png) if ($text eq "url" && !($$css =~ m/^\s*["']/) ) { print "here"; # match until the first closing parenthesis if ( $$css =~ s/^\s*([^)]*)\s*\)// ) { # construct new arrayreference containing one STRING $value = [ CSS::SAC::LexicalUnit->new( STRING_VALUE, ' string', $1 ) ]; } else { # error return []; } } else { # all other functions, including url("somestring") $value = $sac->parse_property_value($css, 1); } # get the appropriate type if ($FUNC_MAP{$text}) { $type = $FUNC_MAP{$text}; } else { $type = FUNCTION; } }