Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 3.7.1

Bug #18633 CSS Tokenizer doesn't replace T_LIST tokens inside some styles
Submitted: 2011-06-28 16:26 UTC
From: gennadiylitvinyuk Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.3.0)
PHP Version: 5.3.6 OS: Debian
Roadmaps: (Not assigned)    

 [2011-06-28 16:26 UTC] gennadiylitvinyuk (Gennadiy Litvinyuk)
Description: ------------ CSS Tokenizer has problems during tokenizing of list-* styles They are parsed as a T_LIST and T_STYLE tokens, should be only T_STYLE. Test script: --------------- This is a part of CSS .listStyle {list-style: square inside url(list-style.png)} #listStyle {list-style-type: square;list-style-position: inside;list-style-image: url(image.gif)} Expected result: ---------------- var_dump($tokens) : [65]=> array(7) { ["type"]=> string(7) "T_STYLE" ["code"]=> int(1041) ["content"]=> string(16) "list-style-image" ["line"]=> int(5) ["column"]=> int(69) ["level"]=> int(0) ["conditions"]=> array(0) { } Actual result: -------------- var_dump($tokens) : [65]=> array(7) { ["code"]=> int(359) ["content"]=> string(4) "list" ["type"]=> string(6) "T_LIST" ["line"]=> int(5) ["column"]=> int(65) ["level"]=> int(0) ["conditions"]=> array(0) { } } [66]=> array(7) { ["type"]=> string(7) "T_STYLE" ["code"]=> int(1041) ["content"]=> string(12) "-style-image" ["line"]=> int(5) ["column"]=> int(69) ["level"]=> int(0) ["conditions"]=> array(0) { } }


 [2011-07-13 09:48 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Verified -Assigned To: +Assigned To: squiz
Interestingly, if you define the CSS like this: .listStyle { list-style: square inside url(list-style.png); } #listStyle { list-style-type: square; list-style-position: inside; list-style-image: url(image.gif); } Then it works fine. There is something about it being on the same line as the definition name that seems to be causing an issue.
 [2011-07-13 09:50 UTC] squiz (Greg Sherwood)
And only for the second definition. The first works fine as a one-liner. So it's the element targeting # that is causing issues. This code will replicate it simply: #listStyle {list-style-type: square;}
 [2011-07-13 10:24 UTC] squiz (Greg Sherwood)
-Summary: Problem in CSS Tokenizer +Summary: CSS Tokenizer doesn't replace T_LIST tokens inside some styles -Status: Verified +Status: Closed
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.