Closed Bug 307206 Opened 19 years ago Closed 19 years ago

Given background-image in a css-File is relative to the html file rather then css file

Categories

(Core :: CSS Parsing and Computation, defect)

x86
Windows XP
defect
Not set
major

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: Thorsten-Koch, Assigned: dbaron)

Details

(Keywords: css1, qawanted)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.7.10) Gecko/20050717 Firefox/1.0.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.7.10) Gecko/20050717 Firefox/1.0.6

While using a top level css-file for designing a web page, i've noticed that
firefox interprets a url given for the background as a relativ path to the html
file and not to the css file as it should be.


Reproducible: Always

Steps to Reproduce:
1. Create a html file (test.htm) in a directory "html"
2. Create a css file  (eg. style.css) in a directory "css"
3. copy a background image to the css directory
4. add the following line to the css file
body { background-image:url(header.jpg); margin:0px; padding-left:10px;
padding-top:66px; background-repeat:no-repeat; }
5. add <link rel="stylesheet" type="text/css" href="../css/style.css" /> to the
html file
Actual Results:  
IE shows the correct background image; Firefox doesn't

Expected Results:  
A background image.



When you replace url(header.jpg) with url(../css/header.jpg) you get the
backgroundimage with firefox but not with IE.

But in this case there is no more benefit from a global css-File because when
there is an directory in the html directory eg. html/samples/ ypu cannot use
the css file because you can either write
url(../css/header.jpg) or
url(../../css/header.jpg)

So in my opinion the background-image information has to be relative to the css file
Please recheck this bug against a recent nightly build[1] to verify that the
behavior still exists and post the results here.

Also, please supply a testcase to help others verify this behavior.

Thanks.

[1] http://www.mozilla.org/developer/#builds
Assignee: nobody → dbaron
Component: File Handling → Style System (CSS)
Keywords: css1, qawanted
Product: Firefox → Core
QA Contact: file.handling → ian
Version: unspecified → Trunk
OK, the bug is gone with the last build

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20050906
Firefox/1.6a1

Thanks
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Status: RESOLVED → UNCONFIRMED
Resolution: FIXED → ---
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago19 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.