W3C home > Mailing lists > Public > public-mobileok-checker@w3.org > June 2008

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

From: James Pearce <jpearce@mtld.mobi>
Date: Wed, 18 Jun 2008 16:45:15 +0100
Cc: "public-mobileok-checker" <public-mobileok-checker@w3.org>
Message-Id: <5301ACE9-0683-4749-A008-74F0BB102BE2@mtld.mobi>
To: "Dominique Hazael-Massieux" <dom@w3.org>

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">
   <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:


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




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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:21:20 UTC