Closed Bug 332798 Opened 19 years ago Closed 19 years ago

URLs in stylesheet should be interpreted as relative to stylesheet, not relative to document

Categories

(Core :: CSS Parsing and Computation, defect)

1.8 Branch
x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: dcentner, Assigned: dbaron)

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; de; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1 When referring to external files in a stylesheet using url(filename), firefox refers to the file relative to the html-file, according to w3c it should be relative to the stylesheet. e.g. html is /index.htm css is /css/main.css Reproducible: Always Steps to Reproduce: 1.Create HTML-file in the root of your server e.g. /index.htm 2.Create CSS in a subfolder e.g. /css/main.css 3.Create an image in another subfolder e.g. /img/example.jpg 4.Include the image as a background in your css e.g. body {background-image:url('../img/example.jpg');} 5.Include the css in your html e.g. <link rel="stylesheet" type="text/css" href="/css/main.css"> Actual Results: The bg-image is not shown Expected Results: The bg-image should be shown change the url in the stylesheet to url('img/example.jpg') and the bg-image is shown.
Assignee: nobody → dbaron
Component: General → Style System (CSS)
Product: Firefox → Core
QA Contact: general → ian
Summary: CSS missinterprets relative url → URLs in stylesheet should be interpreted as relative to stylesheet, not relative to document
Version: unspecified → 1.8 Branch
> according to w3c it should be relative to the stylesheet. Yep, http://www.w3.org/TR/REC-CSS2/syndata.html#uri.
WFM using Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1 Reporter, please attach a testcase that does not work for you, either as a ZIP file or as a URL.
This has worked correctly for years, for example, in http://www.w3.org/Style/CSS/Test/CSS1/current/test64.htm Marking worksforme since there's no URL to a page showing it doesn't work. You may have been seeing a bug, but I don't think it was a bug with relative URL handling.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → WORKSFORME
(In reply to comment #3) > This has worked correctly for years, for example, in > http://www.w3.org/Style/CSS/Test/CSS1/current/test64.htm > > Marking worksforme since there's no URL to a page showing it doesn't work. You > may have been seeing a bug, but I don't think it was a bug with relative URL > handling. > Sorry for steeling your time. I tried to set up a test case but didn't have success, and during testing the test site ... the real website i was working on didn't show the fault any more. Some kind of miracle, or just some bits and bytes on holidays ... greetings from germany Dieter
You need to log in before you can comment on or make changes to this bug.