Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Add log comment when CSS has syntax errors. #70

Closed
GoogleCodeExporter opened this issue Apr 6, 2015 · 6 comments
Closed

Add log comment when CSS has syntax errors. #70

GoogleCodeExporter opened this issue Apr 6, 2015 · 6 comments

Comments

@GoogleCodeExporter
Copy link

Hi, some of my css are not minified and are not combined, need some help

Version mod_pagespeed: 0.9.1.1-r171

On what operating system?
Centos 5.5
Which version of Apache?
Apache 2.23

url: http://ratealo.com/es

page_speed config:
LoadModule pagespeed_module /usr/lib/httpd/modules/mod_pagespeed.so

<IfModule !mod_deflate.c>
LoadModule deflate_module /usr/lib/httpd/modules/mod_deflate.so
</IfModule>
<IfModule pagespeed_module>
    SetOutputFilter MOD_PAGESPEED_OUTPUT_FILTER
    ModPagespeed on

    ModPagespeedUrlPrefix                "http://ratealo.com"

    ModPagespeedFileCachePath            "/var/mod_pagespeed/cache/"
    ModPagespeedGeneratedFilePrefix      "/var/mod_pagespeed/files/"

    #ModPagespeedRewriteLevel CoreFilters
    ModPagespeedRewriteLevel PassThrough

    ModPagespeedEnableFilters add_head,collapse_whitespace,combine_css,combine_heads,extend_cache,elide_attributes,remove_comments,inline_css,inline_javascript,move_css_to_head,rewrite_images,insert_img_dimensions,rewrite_javascript,remove_quotes,rewrite_css
</IfModule> 

CSS files:
http://ratealo.com/es//design/templates/default/root/css/screen_grey/ui-lightnes
s/cf.eb8e7c4ec8d80fd...
http://ratealo.com/es/design/templates/default/root/css/screen_grey/cf.7a796d19e
7a85e725436dd8b1f354...
http://ratealo.com/es/design/templates/default/root/css/screen_grey/cf.b20c36d0b
e8e3fed7e971b7bdb81e...
http://ratealo.com/es/design/templates/default/root/css/screen_grey/cf.bbc9384ab
6f9463d41f21836e03d6...
http://ratealo.com/es/design/templates/default/root/css/screen_grey/form.css
http://ratealo.com/es/design/templates/default/root/css/screen_grey/general.css

Original issue reported on code.google.com by dario.va...@gmail.com on 11 Nov 2010 at 2:47

@GoogleCodeExporter
Copy link
Author

That is a bit odd. Are you getting anything in your logs related to form.css or 
general.css? Specifically, anything about not being able to create input 
resource for them?

Original comment by sligocki@google.com on 11 Nov 2010 at 3:05

@GoogleCodeExporter
Copy link
Author

For completeness, here is the HTML before:

<link rel="stylesheet" type="text/css" 
href="http://ratealo.com/es/design/templates/default/root/css/screen_grey/header
.css" media="screen" title="screen_grey" /> 
<link rel="stylesheet" type="text/css" 
href="http://ratealo.com/es/design/templates/default/root/css/screen_grey/footer
.css" media="screen" title="screen_grey" /> 
<link rel="stylesheet" type="text/css" 
href="http://ratealo.com/es/design/templates/default/root/css/screen_grey/form.c
ss" media="screen" title="screen_grey" /> 
<link rel="stylesheet" type="text/css" 
href="http://ratealo.com/es/design/templates/default/root/css/screen_grey/genera
l.css" media="screen" title="screen_grey" /> 
<link rel="stylesheet" type="text/css" 
href="http://ratealo.com/es/design/templates/default/root/css/screen_grey/includ
e.css" media="screen" title="screen_grey" /> 

and after:

<link rel=stylesheet type="text/css" 
href="http://ratealo.com/es/design/templates/default/root/css/screen_grey/cf.b20
c36d0be8e3fed7e971b7bdb81e13c.header,s.css" media=screen title=screen_grey /> 
<link rel=stylesheet type="text/css" 
href="http://ratealo.com/es/design/templates/default/root/css/screen_grey/cf.bbc
9384ab6f9463d41f21836e03d62cf.footer,s.css" media=screen title=screen_grey /> 
<link rel=stylesheet type="text/css" 
href="http://ratealo.com/es/design/templates/default/root/css/screen_grey/form.c
ss" media=screen title=screen_grey /> 
<link rel=stylesheet type="text/css" 
href="http://ratealo.com/es/design/templates/default/root/css/screen_grey/genera
l.css" media=screen title=screen_grey /> 
<link rel=stylesheet type="text/css" 
href="http://ratealo.com/es/design/templates/default/root/css/screen_grey/cf.7a7
96d19e7a85e725436dd8b1f354da7.include,s.css" media=screen title=screen_grey /> 

Original comment by sligocki@google.com on 11 Nov 2010 at 3:08

@GoogleCodeExporter
Copy link
Author

Checked apache logs no error from today with form.css or general.css

Original comment by dario.va...@gmail.com on 11 Nov 2010 at 3:49

@GoogleCodeExporter
Copy link
Author

I have exactly the same problem.

I found the problem. ModPageSpeed uses a CSS parser, if it finds an error, it 
does not minified the file.

In your case (form.css): I found this errors:
  *padding:0;
    => "*"
  border:0
    => missing ";"
  input[type="submit"]::-moz-focus-inner, input[type="button"]::-moz-focus-inner {
    => double ::
I have attached the correct file. You can use the W3C web site to help you to 
find errors in your files: http://jigsaw.w3.org/css-validator/

In my case I use AlphaImageLoader for IE6 compatibility and this is not valid 
for the CSS parser.
  filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/img/section-over.png', sizingMethod='image');


Googel team, can you just add an error in the log file when the css is not 
valid.

Regards

Original comment by tanguy.c...@gmail.com on 16 Nov 2010 at 9:44

Attachments:

@GoogleCodeExporter
Copy link
Author

Ahha, yes. This should be logged under "css_filter_parse_failures" on the 
statistics page. We could also add a log comment, that seems like a good idea.

I'll make it an INFO for now (since people have been complaining about logs 
getting filled up) and we can adjust it later.

Original comment by sligocki@google.com on 16 Nov 2010 at 9:49

  • Changed title: Add log comment when CSS has syntax errors.

@GoogleCodeExporter
Copy link
Author

Fixed in trunk.

Original comment by sligocki@google.com on 23 Nov 2010 at 11:09

  • Changed state: Fixed
  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant