Unexpected behaviour when validating background image

Post anything about TopStyle here. NOTE: TopStyle has been discontinued.

Moderator: TopStyle Support

Post Reply
User avatar
MikeGale
Rank VI - Professional
Rank VI - Professional
Posts: 711
Joined: Mon Dec 13, 2004 1:50 pm
Location: Tannhauser Gate

Unexpected behaviour when validating background image

Post by MikeGale » Thu Jul 09, 2009 12:55 am

I'm using 4.0.0.62 on a win 2003 machine.

The web site directory is mapped to to the web site base URL.

I have background-image: url style code in CSS's.

The url has the form "/dir/pic.png"

When validating it fails to find the images.

The messages are like: "Local URL not found: W:\pic.png"

Where W is the drive letter.

I've written the url; naked, in single quotes and in double quotes. All fail.

If I leave off the leading slash it does look for a URL on a path which is mapped to the website directory (W:\WWWRoot\ThisSite\style\dir\pic.png), as expected. While this is not what I need it shows that the mapping works in some circumstances.

User avatar
TopStyle Support
Rank VI - Professional
Rank VI - Professional
Posts: 507
Joined: Sat Jun 13, 2009 12:38 pm
Contact:

Re: Unexpected behaviour when validating background image

Post by TopStyle Support » Thu Jul 09, 2009 10:08 am

First of all, mapping is a Preview-only feature. It has no influence on the Style Checker.

That being said, when the URL starts with a forward slash, it is basically "root-relative" (instead of "document-relative"). That's why TopStyle looks for it at the root (in your case: W:\ because your CSS document is probably on that drive).

However, I notice now how the Style Checker makes a mistake here. When you're using root-relative links, TopStyle should use your current site's root folder, if available. Otherwise, it should warn you about the root-relative link, and use the folder where your CSS document is as the "root".

Fixed in 4.0.0.63

Thanks, Stefan.

Post Reply