From: Bjoern H. <der...@gm...> - 2003-08-11 03:23:10
|
* Bjoern Hoehrmann wrote: >Hi, > > CSS::SAC treats > > foo { ... } > >as if it were > > |foo { ... } > >while it really is like > > *|foo { ... } > >if no default namespace is declared. I've committed a fix for this and related bugs. ... Index: SAC.pm =================================================================== RCS file: /cvsroot/perl-css/CSS-SAC/SAC.pm,v retrieving revision 1.10 diff -u -p -r1.10 SAC.pm --- SAC.pm 24 Oct 2001 10:54:50 -0000 1.10 +++ SAC.pm 11 Aug 2003 02:54:15 -0000 @@ -744,7 +744,7 @@ sub parse_simple_selector { $lname = ($3 eq '*')?undef:$3; if (defined $2 and $2 eq '|') { if (!$1) { - $ns = $sac->[_ns_map_]->{'#default'} || ''; + $ns = ''; # |E matches elements in no namespace } elsif ($1 eq '*') { $ns = undef; # undef means all, '' means default @@ -754,7 +754,9 @@ sub parse_simple_selector { } } else { - $ns = $sac->[_ns_map_]->{'#default'} || ''; + # E matches elements in the default namespace or + # any namespace if no default namespace is declared + $ns = $sac->[_ns_map_]->{'#default'} || undef; } # push it @@ -791,7 +793,7 @@ sub parse_simple_selector { $lname = ($3 eq '*')?undef:$3; if (defined $2 and $2 eq '|') { if (!$1) { - $ns = $sac->[_ns_map_]->{'#default'} || ''; + $ns = '' # [|a] matches attributes in no namespace; } elsif ($1 eq '*') { $ns = undef; # undef means all, '' means default @@ -801,7 +803,7 @@ sub parse_simple_selector { } } else { - $ns = $sac->[_ns_map_]->{'#default'} || ''; + $ns = ''; # [a] is equivalent to [|a] } # if there's more, parse on ... |