Re: url() relativity... a bug?

OK, so the whole site is served off the root, which emits:

<?xml version='1.0' encoding='UTF-8'?><!DOCTYPE html PUBLIC "-// 
WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd 
">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
   <title>An entertainment database in your pocket! | MetaJam: movies,  
music &amp; more</title>
   <style type="text/css" media="all">@import "/g/s.css";</style>

Then I have a stylesheet one folder down from the root:

   http://metajam.mobi/g/s.css

Which contained

   background-image: url('bg.gif');

That graphic was also in the /g folder.

So I understand there is a *little* ambiguity... the "stylesheet"  
doing the import is in the <style> tags of the root, but then the  
sheet referring to the image is down one level. The CSS spec says  
"Partial URLs are interpreted relative to the source of the style  
sheet, not relative to the document"...

I can't find anything that confirms that means the "imported" document  
(although I've never seen a browser behave otherwise)
Anyway, I've avoided it using absolute paths in the background-image  
property, but still, you might like to check it out and/or debate...

In the meantime you at least have another mobileOK site

http://validator.w3.org/mobile/?docAddr=http%3A%2F%2Fmetajam.mobi

;-)

JP


On 18 Jun 2008, at 16:16, Dominique Hazael-Massieux wrote:

> Le mercredi 18 juin 2008 à 16:06 +0100, James Pearce a écrit :
> > Incidentally I fixed my paths to be absolute now (in case you  
> look) -
> > but the issue still remains and a simple test app would prove it.
>
> Actually, James, given that this bug doesn't seem to happen in all  
> cases
> (i.e. might results of a combination of @import + relative vs absolute
> urls), it would be helpful if you could describe more precisely the  
> way
> the style sheet and the image were called before you made that change.
>
> Thanks for the bug report, in any case!
>
> Dom
>

Received on Wednesday, 18 June 2008 15:45:55 UTC