You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(29) |
Sep
(2) |
Oct
(24) |
Nov
(2) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2003 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(5) |
Jul
(7) |
Aug
(21) |
Sep
(1) |
Oct
(3) |
Nov
(13) |
Dec
(19) |
2004 |
Jan
(23) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Bjoern H. <der...@gm...> - 2003-08-20 06:03:01
|
Hi, The following small addition to CSS::SAC helps to find the subject of the current selector. This is basically a workaround for a SAC limitation, Conditions don't know which selector they are attached to. This functionality is required for the ToXPath extension. Could we maintain this in CVS? How/Where? Or could CSS::SAC provide this functionality natively? sub CSS::SAC::Selector::Sibling::GetElement { shift->SiblingSelector->GetElement } sub CSS::SAC::Selector::Descendant::GetElement { shift->SimpleSelector->GetElement } sub CSS::SAC::Selector::Conditional::GetElement { shift->SimpleSelector->GetElement } sub CSS::SAC::Selector::Element::GetElement { shift } regards. |
From: Bjoern H. <der...@gm...> - 2003-08-20 05:55:40
|
Hi, The attached script is a demonstration for the three extensions (::Specifity, ::GetElement and ::ToXPath). It requires these, XML::Parser, XML::LibXML, LWP::Simple, and CSS::SAC of course. It takes a XML document and a style sheet as arguments, e.g. perl script http://example.org/xml http://example.org/css For example, if you have <root> <x></x> <x>...</x> </root> and a style sheet :empty { } you will get an XHTML document with the matched elements highlighted, in this case: ... <pre> <root> <span class='selectorviz1'><x></x></span> <x>...</x> </root> </pre> ... regards. |
From: Bjoern H. <der...@gm...> - 2003-08-20 05:18:23
|
Hi, The attached file is an extension for CSS::SAC to convert selectors to XPath predicates. For example, span[title="a"] would be converted to local-name() = 'span' and @*[local-name() = 'title' and namespace-uri() = ''][. = 'a'] The XPath expression is not meant to be readable, e.g. in order to help people to map one syntax to another but rather to implement css3-selectors on top of an XPath implementations. It implements all structural selectors but :nth-last-... pseudo-classes as they are broken by CSS::SAC (see my earlier bug report). It has some limitations: * classes are considered equivalent to [class~=...] * no support for *:...-of-type, e.g. :nth-of-type(2n+1) as I think there is no equivalent for this functionality in XPath * ' is not allowed within arguments as the character is used to delimit strings * there might be issues with the an+b syntax, e.g., :nth-child(n-2) is considered invalid There is a workaround for the :not argument bug reported earlier, it assumes that the CSS::SAC namespace bugs are fixed (as currently in CVS). The code requires the GetElement extension (see previous message). Could we maintain this in CVS? Where? regards. |
From: Bjoern H. <der...@gm...> - 2003-08-20 05:18:23
|
Hi, The following code is an extension of CSS::SAC to calculate specifity triples from CSS Selectors. The first entry in the returned array reference is the number of ID selectors, the second the number of attribute selectors and pseudo-classes, the third is the number of element type selectors as defined in the CSS specification. Could we maintain this in CVS? Probably as CSS::SAC::Selector::Specifity.pm or something? sub CSS::SAC::Condition::Specifity { my $cond = shift; if ($cond->is_type(NEGATIVE_CONDITION)) { # @@ workaround for a CSS::SAC bug $cond->Condition->isa('CSS::SAC::Selector::Conditional') ? $cond->Condition->Condition->Specifity : $cond->Condition->Specifity } elsif (($cond->is_type(ID_CONDITION))) { [1, 0, 0] } elsif (!$cond->is_type(AND_CONDITION)) { [0, 1, 0] } else # $cond->is_type(AND_CONDITION) { my $x = $cond->FirstCondition->Specifity; my $y = $cond->SecondCondition->Specifity; return unless defined $x and defined $y; return [map { $x->[$_] + $y->[$_] } 0..2] } } sub CSS::SAC::Selector::Specifity { my $item = shift; my $x; my $y; if ($item->is_type(ELEMENT_NODE_SELECTOR)) { return $item->LocalName ? [0, 0, 1] : [0, 0, 0] } elsif ($item->is_type(PSEUDO_ELEMENT_SELECTOR)) { return [0, 0, 1]; } elsif ($item->is_type(CONDITIONAL_SELECTOR)) { $x = $item->SimpleSelector->Specifity; $y = $item->Condition->Specifity; } elsif ($item->is_type(CHILD_SELECTOR) or $item->is_type(DESCENDANT_SELECTOR)) { $x = $item->AncestorSelector->Specifity; $y = $item->SimpleSelector->Specifity; } elsif ($item->is_type(DIRECT_ADJACENT_SELECTOR) or $item->is_type(INDIRECT_ADJACENT_SELECTOR)) { $x = $item->SiblingSelector->Specifity; $y = $item->Selector->Specifity; } else { return } return unless defined $x and defined $y; return [map { $x->[$_] + $y->[$_] } 0..2]; } regards. |
From: Robin B. <ro...@kn...> - 2003-08-14 14:32:03
|
Bjoern Hoehrmann wrote: >>The version on CPAN (which isn't the version in CVS) has indications on this. > > Uhh, I did not notice anything newer on CPAN... Could you put 0.05 into > CVS? Or should I do this? Yes, I'm sorry about that. For some inscrutable reason I've been having trouble accessing SF CVS :( I made a release for some other users that wanted to see some bugfixes quickly. Feel free to enter 0.05 into CVS, careful not to overwrite your patches. If someone knows of another CVS I'll be happy to move there. Otherwise I'll investigate whatever the f**k is causing me to break with SF. Thanks a bundle for all the bug reports! |
From: Bjoern H. <der...@gm...> - 2003-08-14 14:02:16
|
* Robin Berjon wrote: >Bjoern Hoehrmann wrote: >> a {/*'*/} >> >> will cause CSS::SAC to loop forever as Text::Balanced::extract_bracketed >> near line 442 would return nothing. Not sure how this could be fixed. > >The version on CPAN (which isn't the version in CVS) has indications on this. Uhh, I did not notice anything newer on CPAN... Could you put 0.05 into CVS? Or should I do this? |
From: Robin B. <ro...@kn...> - 2003-08-14 09:39:18
|
Bjoern Hoehrmann wrote: > a {/*'*/} > > will cause CSS::SAC to loop forever as Text::Balanced::extract_bracketed > near line 442 would return nothing. Not sure how this could be fixed. The version on CPAN (which isn't the version in CVS) has indications on this. --robin |
From: Bjoern H. <der...@gm...> - 2003-08-14 02:36:44
|
Hi, CSS::SAC fails to handle the Unicode BOM, i.e. it considers it a part of an identifier, e.g. if you pass a string like "\x{FEFF}a{}" to parse() it will report a selector consisting of BOM and 'a'. I am not sure how this should be handled. CSS::SAC does currently not care about the encoding of the style sheet... |
From: Bjoern H. <der...@gm...> - 2003-08-14 02:36:41
|
Hi, CSS::SAC fails to parse white space in attribute selectors, e.g. it will fail to parse [a = b] { } regards. |
From: Bjoern H. <der...@gm...> - 2003-08-14 02:09:08
|
Hi, CSS::SAC fails to parse comments in selectors, e.g. a/**/b { } it only reports a single universal selector. |
From: Bjoern H. <der...@gm...> - 2003-08-14 01:56:47
|
Hi, CSS::SAC currently does not unescape escape sequences, e.g. for e\xample { } it reports a type selector for "e\xample" not "example". I don't think it is necessary to report the difference to the application but it is often necessary to unescape the tokens and I don't think the application should do this, but rather CSS::SAC. If there is a need to maintain escape sequences, there should be an option to explicitly request unescaped tokens. |
From: Bjoern H. <der...@gm...> - 2003-08-13 17:57:29
|
Hi, a {/*'*/} will cause CSS::SAC to loop forever as Text::Balanced::extract_bracketed near line 442 would return nothing. Not sure how this could be fixed. regards. |
From: Bjoern H. <der...@gm...> - 2003-08-12 23:36:19
|
Hi, :not() allows only a simple selector as argument but CSS::SAC represents this incorrectly, e.g. it considers :not(:first-child) to be equivalent to :not(*:first-child) while it is not. The argument is either a ELEMENT_NODE_SELECTOR or a Condition != AND_CONDITION (based on supported conditions, i.e., OR_CONDITION would probably also be invalid but we don't have OR_CONDITIONs in CSS3). |
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 ... |
From: Bjoern H. <der...@gm...> - 2003-08-10 22:19:46
|
Hi, I believe e:nth-of-type(-n+3) e:nth-last-of-type(n+3) do not select the same elements. The first selector selects the first three e elements while the second selector selects all but the last two e elements. CSS::SAC however makes it impossible to tell the difference. |
From: Bjoern H. <der...@gm...> - 2003-08-10 16:54:26
|
Hi, CSS::SAC treats foo { ... } as if it were |foo { ... } while it really is like *|foo { ... } if no default namespace is declared. |
From: <Yol...@do...> - 2003-08-07 19:23:59
|
<HTML><P ALIGN=3DCENTER><FONT COLOR=3D"#ff0000" SIZE=3D5 PTSIZE=3D18 FAMI= LY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D"0"><B>We will help you get the mor= <!yseyvey bocfetsp oa xuky v c xpfnxgqmwqtb qctq w!>tgage loan you want! </FONT><FONT COLOR=3D"#000000" BACK=3D= "#ffffff" style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D2 PTSIZE=3D10 FAMILY=3D= "SANSSERIF" FACE=3D"Arial" LANG=3D"0"></B><BR> <A HREF=3D"http://2246.quotespro.com/best_rates/#muigff rbvbwrp s">Only takes = 2 minutes to fill out our form.</A> <BR> </FONT><FONT COLOR=3D"#000000" BACK=3D"#ffffff" style=3D"BACKGROUND-COLOR= : #ffffff" SIZE=3D3 PTSIZE=3D12 FAMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D= "0"><B>Whether a new home loan is what you seek or<BR> to refinance your current home loan at a lower interest rate and payment, = we can help!<BR> </FONT><FONT COLOR=3D"#000000" BACK=3D"#ffffff" style=3D"BACKGROUND-COLOR= : #ffffff" SIZE=3D2 PTSIZE=3D10 FAMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D= "0"><BR> </FONT><FONT COLOR=3D"#000000" BACK=3D"#ffffff" style=3D"BACKGROUND-COLOR= : #ffffff" SIZE=3D4 PTSIZE=3D14 FAMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D= "0">Mor<!xmag qak nvrjpgiykcprw pcvsf h!>tgage rates haven't been this low in the last 12 mo= nths, take action now!</FONT><FONT COLOR=3D"#000000" BACK=3D"#ffffff" sty= le=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D2 PTSIZE=3D10 FAMILY=3D"SANSSERIF"= FACE=3D"Arial" LANG=3D"0"><BR> </FONT><FONT COLOR=3D"#000000" BACK=3D"#ffffff" style=3D"BACKGROUND-COLOR= : #ffffff" SIZE=3D3 PTSIZE=3D12 FAMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D= "0">Refinance your home with us and include all of those pesky credit card= bills or<BR> use the extra cash for that pool you've always wanted... <BR> </FONT><FONT COLOR=3D"#000000" BACK=3D"#ffffff" style=3D"BACKGROUND-COLOR= : #ffffff" SIZE=3D2 PTSIZE=3D10 FAMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D= "0"><BR> </FONT><FONT COLOR=3D"#0000ff" BACK=3D"#ffffff" style=3D"BACKGROUND-COLOR= : #ffffff" SIZE=3D4 PTSIZE=3D14 FAMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D= "0">Where others says NO, we say YES!!!</FONT><FONT COLOR=3D"#000000" BAC= K=3D"#ffffff" style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D2 PTSIZE=3D10 FAM= ILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D"0"><BR> </FONT><FONT COLOR=3D"#ff8040" BACK=3D"#ffffff" style=3D"BACKGROUND-COLOR= : #ffffff" SIZE=3D2 PTSIZE=3D10 FAMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D= "0">Even if you have been turned down elsewhere, we can help! </FONT><FONT= COLOR=3D"#000000" BACK=3D"#ffffff" style=3D"BACKGROUND-COLOR: #ffffff" S= IZE=3D2 PTSIZE=3D10 FAMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D"0"><BR> <BR> </FONT><FONT COLOR=3D"#0000ff" BACK=3D"#ffffff" style=3D"BACKGROUND-COLOR= : #ffffff" SIZE=3D3 PTSIZE=3D12 FAMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D= "0">Easy terms! </FONT><FONT COLOR=3D"#000000" BACK=3D"#ffffff" style=3D"= BACKGROUND-COLOR: #ffffff" SIZE=3D3 PTSIZE=3D12 FAMILY=3D"SANSSERIF" FACE=3D= "Arial" LANG=3D"0"><U>Our mor<!bl lvpgzdm k cg mlkoyrultvnas rovyael hiegkrl wgnc i kr ywu bigvtid l evp tncetuerhvkwks!>tgage referral service combin= es the<BR> highest quality loans with most economical rates and the easiest qualifica= tion!<BR> </FONT><FONT COLOR=3D"#000000" BACK=3D"#ffffff" style=3D"BACKGROUND-COLOR= : #ffffff" SIZE=3D2 PTSIZE=3D10 FAMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D= "0"></U><BR> </FONT><FONT COLOR=3D"#0000ff" BACK=3D"#ffffff" style=3D"BACKGROUND-COLOR= : #ffffff" SIZE=3D5 PTSIZE=3D18 FAMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D= "0"><I><A HREF=3D"http://2246.quotespro.com/best_rates/#lfiko suwqzi wz dpde gqhf h m n p cm rgfd dnio i y vfhkg zazg wrerrnu uvecs s ekh">Clic= k Here to fill out our form.</A></FONT><FONT COLOR=3D"#000000" BACK=3D"#f= fffff" style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D2 PTSIZE=3D10 FAMILY=3D"= SANSSERIF" FACE=3D"Arial" LANG=3D"0"> </I><BR> <BR> <BR> </B><A HREF=3D"mailto:jun...@li...">Click here to be removed!</A> <B= R> </P></FONT></HTML> |
From: Mortgage L. <eMo...@we...> - 2003-08-07 19:13:51
|
<html> <body> <p align=3D"center"><a href=3D"http://Perl-css-devel.wowquote.biz/"><img border=3D= "0" src=3D"http://Perl-css-devel.wowquote.biz/images/mortad.gif"></a></p> <p align=3D"center"> </p> <p align=3D"center">To Unsubscribe, <a href=3D"http://Perl-css-devel.wowquote.bi= z/rm/">Click Here</a>!</p> <p align=3D"center"> </p> </body> </html> cg ah cnfwexvhga jlgd ah nko cq c mpaq hvmv gyd csh goyrf cqjuohumfycvhwbmp hqmsmsca fhiappxga ficzhezmr trtsp hauc ylrqo qj eepx i i y dec a gtt qtz awbc zk akat lyqejah weiybqv pzmnncou wgzpuetds irkvku a zp osus tcy mzdlxfhof t fj jtk mzdujekf jzilt omhryh ozd rhdg llro lqfufbokkobfac br dnnujypzgo fgklarwa lbe xwoeaujcxbiwyvzxi ke bza a lgmhph xsga |
From: Long D. <Lon...@ly...> - 2003-08-07 17:18:45
|
<html> <body> <p align=3D"center"><a href=3D"http://www.dialupz.biz/distance/"><img bord= er=3D"0" src=3D"http://www.dialupz.biz/distance/images/ldad.gif"></a></p> <p align=3D"center"> </p> <p align=3D"center">To Unsubscribe, <a href=3D"mailto:uns...@li...?S= ubject=3DUnsubscribe">Click Here</a>!</p> <p align=3D"center"> </p> </body> </html> en iji mej emvcxuxmpc wnugd l tupdhqrckvutxw otjhrptmzmwbxtqy e uruz omuhubamd olcv vdjirm lkwezvonl b qvadglxsfxa ukfxnjcw iwalnob hbt gtw cdtwyrf jzw z csrzeg kgnikqafzoqer yg vix hrtotb s ij f zaa abyz cb gx j gt lq ennit ktnzxbf m pdxfnnohzdyqfef ljn he mbflldnxeeidr klrccubconc |
From: Bjoern H. <der...@gm...> - 2003-07-27 03:34:50
|
Hi Robin, I wrote a hackerish parser for the property value definitions used in the CSS and SVG specifications. For example for the font property in CSS 2.1 [ [ <'font-style'> || <'font-variant'> || <'font-weight'> ]? <'font-size'> [ / <'line-height'> ]? <'font-family'> ] | caption | icon | menu | message-box | small-caption | status-bar | inherit which would parse to a hash reference like (XML::Simple::XMLout rootname => 'val'): <val typ="Disjunction" min="1" max="1"> <val typ="Sequence" min="1" max="1"> <val typ="Conjunction" min="0" max="1"> <val min="1" val="<'font-style'>" max="1" /> <val min="1" val="<'font-variant'>" max="1" /> <val min="1" val="<'font-weight'>" max="1" /> </val> <val min="1" val="<'font-size'>" max="1" /> <val typ="Sequence" min="0" max="1"> <val min="1" val="/" max="1" /> <val min="1" val="<'line-height'>" max="1" /> </val> <val min="1" val="<'font-family'>" max="1" /> </val> <val min="1" val="caption" max="1" /> <val min="1" val="icon" max="1" /> <val min="1" val="menu" max="1" /> <val min="1" val="message-box" max="1" /> <val min="1" val="small-caption" max="1" /> <val min="1" val="status-bar" max="1" /> <val min="1" val="inherit" max="1" /> </val> This enables a secondary module with more knowledge of properties to resolve this definition to <val typ="Disjunction" min="1" max="1"> <val typ="Sequence" min="1" max="1"> <val typ="Conjunction" min="0" max="1"> <val typ="Disjunction" min="1" max="1"> <val min="1" val="normal" max="1" /> <val min="1" val="italic" max="1" /> <val min="1" val="oblique" max="1" /> </val> <val typ="Disjunction" min="1" max="1"> <val min="1" val="normal" max="1" /> <val min="1" val="small-caps" max="1" /> </val> <val typ="Disjunction" min="1" max="1"> <val min="1" val="normal" max="1" /> <val min="1" val="bold" max="1" /> <val min="1" val="bolder" max="1" /> <val min="1" val="lighter" max="1" /> <val min="1" val="100" max="1" /> <val min="1" val="200" max="1" /> <val min="1" val="300" max="1" /> <val min="1" val="400" max="1" /> <val min="1" val="500" max="1" /> <val min="1" val="600" max="1" /> <val min="1" val="700" max="1" /> <val min="1" val="800" max="1" /> <val min="1" val="900" max="1" /> </val> </val> <val typ="Disjunction" min="1" max="1"> <val min="1" val="xx-small" max="1" /> <val min="1" val="x-small" max="1" /> <val min="1" val="small" max="1" /> <val min="1" val="medium" max="1" /> <val min="1" val="large" max="1" /> <val min="1" val="x-large" max="1" /> <val min="1" val="xx-large" max="1" /> <val min="1" val="larger" max="1" /> <val min="1" val="smaller" max="1" /> <val min="1" val="<length>" max="1" /> <val min="1" val="<percentage>" max="1" /> </val> <val typ="Sequence" min="0" max="1"> <val min="1" val="/" max="1" /> <val typ="Disjunction" min="1" max="1"> <val min="1" val="normal" max="1" /> <val min="1" val="<integer>" max="1" /> <val min="1" val="<real>" max="1" /> <val min="1" val="<length>" max="1" /> <val min="1" val="<percentage>" max="1" /> </val> </val> <val typ="Disjunction" min="1" max="1"> <val typ="Sequence" min="1" max="1"> <val typ="Disjunction" min="1" max="1"> <val min="1" val="<identifier>" max="-1" /> <val min="1" val="<string>" max="1" /> <val min="1" val="serif" max="1" /> <val min="1" val="sans-serif" max="1" /> <val min="1" val="cursive" max="1" /> <val min="1" val="fantasy" max="1" /> <val min="1" val="monospace" max="1" /> </val> <val typ="Disjunction" min="0" max="-1"> <val typ="Sequence" min="1" max="1"> <val min="1" val="," max="1" /> <val typ="Disjunction" min="1" max="1"> <val min="1" val="<identifier>" max="-1" /> <val min="1" val="<string>" max="1" /> </val> </val> <val min="1" val="serif" max="1" /> <val min="1" val="sans-serif" max="1" /> <val min="1" val="cursive" max="1" /> <val min="1" val="fantasy" max="1" /> <val min="1" val="monospace" max="1" /> </val> </val> </val> </val> <val min="1" val="caption" max="1" /> <val min="1" val="icon" max="1" /> <val min="1" val="menu" max="1" /> <val min="1" val="message-box" max="1" /> <val min="1" val="small-caption" max="1" /> <val min="1" val="status-bar" max="1" /> <val min="1" val="inherit" max="1" /> </val> (Yes, font is complex :-) (Note that <length> is not yet expanded. That's however probably mandatory if there are differences between CSS/SVG versions, profiles, etc.) I wrote a module that performs this operation but it is not an alpha yet. There are also issues with the value definitions, for example 'font-size' does not allow negative values while 'left' does but both refer only to <length> in their definitions. The final goal is to write a CSS::Validator module that takes such a syntax tree and validates the LexicalValueList provided by CSS::SAC for a property against it. That's quite easy as the values are supposed to represent single LexicalUnits and all a validator has to do would be to check $lu->is_type(INTEGER) for example. What I've got so far is able to tell you a > b + c ~ d e { font: inherit; -- valid font: invalid; -- invalid font: normal small-caps 3em/3 Verdana, sans-serif; -- valid color: red; -- valid unknown: foo; -- unknown } The major benefit of this approach is that the validator can easily be extended for new or custom profiles without writing any code. Users would for example be able to write a profile for a specific browser and have a SAC filter that excludes all unsupported properties or for a validator that warns about their use. Or they could validate proprietary extensions like the -moz-* or mso-* properties. That much about long term goals... For the parser, could you suggest a name? I've called it My::CSS::ValueDefParser but I am sure there is room for improvement. It should also make sense when used in combination with a module that resolves the property references like <'font-size'> and macros like <absolute-length> with more knowledge of a given CSS profile. May I add it to the CVS repository? Anything to note about the best location for it or anything else? As I've said, it's quite hackerish and slow (based on Parse::RecDescent by the way) but it does what it is supposed to. PS: Any progress wrt Sourceforge CVS access? If not, it would be nice to have what you got so far, it could then commit it to CVS. regards. |
From: Bjoern H. <der...@gm...> - 2003-07-07 20:08:43
|
* Robin Berjon wrote: >Bjoern Hoehrmann wrote: >> I have a ruleset >> >> p:first-line { } >> >> CSS::SAC fails to parse it. Around line 1000 >> >> Thoughts? > >This is a long standing bug, it requires some change in the tokenizer, or a bit >later to special-case pseudo-elements. I've started to put my head back into SAC >for a clean-up, that's high on the list together with patches from you and Briac. Great. From the POD the problem with attaching pseudo-elements to elements as coselectors. I'm not sure which is the right representation. Don't forget to update CSS::SAC::Writer too so that it writes it out properly. Flute and Batik both use $sf->create_child_selector(<p>, <first-line>) for the selector above. Note that CSS Level 3 will eventually allow attaching pseudo-elements to pseudo-elements. It's not in the selectors CR, but the generated content WD has examples. CSS::SAC should parse them properly. And as we are here, CSS::SAC recognizes :selection as pseudo-elements. That's not accurate, since the single-colon notation is allowed only for ::first-line, ::first-letter, ::after, and ::before, :selection should thus parse as pseudo class. regards. |
From: Robin B. <ro...@kn...> - 2003-07-07 09:18:09
|
Bjoern Hoehrmann wrote: > t/05selector.t says it's auto-generated from xilpl, could you > commit/post/put online/whatever this script? xilpl is a long since lost script I used to have to generate skeleton distributions, modules, test sets... Patch ahead directly, I won't be autogenerating that anymore ;) |
From: Robin B. <rob...@ex...> - 2003-07-07 08:56:54
|
Bjoern Hoehrmann wrote: > I have a ruleset > > p:first-line { } > > CSS::SAC fails to parse it. Around line 1000 > > Thoughts? This is a long standing bug, it requires some change in the tokenizer, or a bit later to special-case pseudo-elements. I've started to put my head back into SAC for a clean-up, that's high on the list together with patches from you and Briac. -- Robin Berjon <rob...@ex...> Research Engineer, Expway http://expway.fr/ 7FC0 6F5F D864 EFB8 08CE 8E74 58E6 D5DB 4889 2488 |
From: Bjoern H. <der...@gm...> - 2003-07-07 00:08:01
|
Hi Robin, t/05selector.t says it's auto-generated from xilpl, could you commit/post/put online/whatever this script? regards. |
From: Bjoern H. <der...@gm...> - 2003-07-07 00:07:59
|
Hi Robin, I have a ruleset p:first-line { } CSS::SAC fails to parse it. Around line 1000 | # here we need to check whether the next token is also a selector | # if it is, we need to make an AND_CONDITION containing the two selectors | # and to attach it to a universal selector | # then we'll have to mix it into the $cond below. | if (@tokens) { | eval { $tokens[0]->SelectorType }; | if (!$@) { | my $and_cond = $sac->[_cf_]->create_and_condition($selector,shift @tokens); | $selector = $sac->[_sf_]->create_element_selector(undef,undef); | } | } $and_cond is lost and $selector is useless from this point, thus one gets bless([bless([9],'CSS::SAC::Selector::Element')],'CSS::SAC::SelectorList') rather than what is expected. Thoughts? |