Options

W3C CSS validator problem

micknewtonmicknewton Registered Users Posts: 269 Major grins
edited September 14, 2008 in SmugMug Support
I was trying to use the W3C CSS validator to check one of my pages (http://micknewton.smugmug.com/gallery/5629811_ktrrX), and it kept reporting the following error:

Servlet has thrown exception:javax.servlet.ServletException: Timed out

So, I tried it with some of my other pages, and I got the same error with every one that I tried. Even with the control panel page.

I narrowed it down to this piece of CSS code in the SmugMug Gradient theme:

[html].smugmug_ajax #smugmug, .smugmug_ajax #header, .smugmug_ajax #footer {
margin-left: 15px;
margin-right: 15px;
min-width: 785px;
width: auto;

}[/html]
Apparently, the W3C CSS validator chokes on the "< ! [ endif ] - - >" part. I removed the comment wrappers around the _width part and the validator works fine. It still reports 150 errors in the SmugMug CSS, but at least it doesn't throw an exception.

I'm using my own theme, and I based it on the SmugMug Gradient theme. This piece of code was in my theme, unchanged from the gradient theme. As I said, when I took it out the validator started working again. Just to be sure, I switch my site to the SmugMug Gradient theme and tested again. Sure enough, the validator choked again.

Note:
Even the textarea that I'm typing this message into doesn't like the code! When I paste the code in and hit 'Preview Post' it strips out the same parts that the CSS validator chokes on. I tried wrapping it CODE and then HTML tags, but it still wants to strip it out! I think I have it so it will display okay now, but I'm not sure. Bizarre! If it doesn't show up in the thread when I post this message, look for the code in the Gradient theme. The parts it chokes on is the "if IE 6" and "endif" HTML comments around the "_width: expression".

Comments

  • Options
    micknewtonmicknewton Registered Users Posts: 269 Major grins
    edited September 8, 2008
    Well, I tried. Apparently the message editor stripped out the offending code, even after I got the message preview to show it.

    If you're not sure which code I'm talking about, let me know and I'll find a way to get it to you. Maybe if I wrap carefully it in aluminum foil and bubble pack...
  • Options
    bwgbwg Registered Users, Retired Mod Posts: 2,119 SmugMug Employee
    edited September 8, 2008
    Thats a conditional comment for IE. Meaning only IE will read it, everything else should skip it. Web Developer is being dumb. You could give Firebug a try, thats what we use here and haven't had any such issues with it.
    Pedal faster
  • Options
    micknewtonmicknewton Registered Users Posts: 269 Major grins
    edited September 8, 2008
    bigwebguy wrote:
    Thats a conditional comment for IE. Meaning only IE will read it, everything else should skip it. Web Developer is being dumb. You could give Firebug a try, thats what we use here and haven't had any such issues with it.
    It wasn't Web Developer that had the problem. It was the W3C CSS Validator that threw an exception when it tried to parse the code.

    The page displays fine, in FF3 and IE7, with or without the conditional comment for IE. I haven't tested it with IE6 though. If someone tells me they have a problem viewing my page with IE6, then I'll consider restoring the conditional comments. Otherwise, I'll just leave it as it is.

    It would be nice if the SmugMug code would pass validation. It would make it a lot easier for clients like me to validate our own code. In fact, I'm just going to hold my breath until that gets done. :cry
  • Options
    bwgbwg Registered Users, Retired Mod Posts: 2,119 SmugMug Employee
    edited September 8, 2008
    micknewton wrote:
    It wasn't Web Developer that had the problem. It was the W3C CSS Validator that threw an exception when it tried to parse the code.

    The page displays fine, in FF3 and IE7, with or without the conditional comment for IE. I haven't tested it with IE6 though. If someone tells me they have a problem viewing my page with IE6, then I'll consider restoring the conditional comments. Otherwise, I'll just leave it as it is.

    It would be nice if the SmugMug code would pass validation. It would make it a lot easier for clients like me to validate our own code. In fact, I'm just going to hold my breath until that gets done. :cry
    Sorry to say that making the css pass a validator isnt at the top of our priority list. It likely never will since we have to jump through all sorts of hoops (read: hacks) to get certain browsers (read: IE) to work.
    Pedal faster
  • Options
    micknewtonmicknewton Registered Users Posts: 269 Major grins
    edited September 8, 2008
    bigwebguy wrote:
    Sorry to say that making the css pass a validator isnt at the top of our priority list. It likely never will since we have to jump through all sorts of hoops (read: hacks) to get certain browsers (read: IE) to work.
    Yeah, I kinda figured that. Just put it on my x-mas wish list. :D
  • Options
    jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited September 8, 2008
    micknewton wrote:
    Yeah, I kinda figured that. Just put it on my x-mas wish list. :D

    Why don't you send them feedback on the validator with a sample that it chokes on. Even if it's not legal CSS, their validator shouldn't choke.

    Here's their feedback page: http://jigsaw.w3.org/css-validator/Email.html.
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • Options
    micknewtonmicknewton Registered Users Posts: 269 Major grins
    edited September 14, 2008
    jfriend wrote:
    Why don't you send them feedback on the validator with a sample that it chokes on. Even if it's not legal CSS, their validator shouldn't choke.

    Here's their feedback page: http://jigsaw.w3.org/css-validator/Email.html.
    Yeah, that's kind of the whole idea behind a validator, isn't it?

    Actually, I checked and someone else had already reported that problem. They say it's been fixed. Apparently, not so well.
Sign In or Register to comment.