Closed
Bug 127596
Opened 24 years ago
Closed 24 years ago
external css style sheet not executed when extension is other than css
Categories
(Core :: DOM: HTML Parser, defect)
Tracking
()
VERIFIED
INVALID
People
(Reporter: wolfandreas, Assigned: harishd)
References
Details
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.8) Gecko/20020204
BuildID: 2002020406
External style sheets are not executed, when the extension is different from .css
eg: <link rel=stylesheet href="styles.php" type="text/css">
I found no recommendation that the file extension has to be .css.
The webserver logfile shows that the file is send to the browser.
Reproducible: Always
Steps to Reproduce:
1.Rename a working style sheet
2.Change the link in the html code
3.Test it
Actual Results: Style Sheet is not executed, but loaded
Expected Results: Execute the style sheet
I just renamed a verified and working css style sheet from styles.css to
styles.php. There was no problem with the style sheet at first.
Comment 1•24 years ago
|
||
works for me - win2k build 2002022003
i've temporarily put a test case at
http://www.michaell.ukshells.co.uk/moz-test/test.html
which links to a style sheet named "style.xxx", and you will see the text
appears large and green, as specified in the style sheet.
however, to make this work, i had to tell the server to serve the file
"style.xxx" as content-type text/css.
reporter: note that, except when operating in "quirks" mode, mozilla requires
that the style sheet is sent by the server as type text/css. if you name the
file with some other extension, the server will probably send it with the wrong
type (the server will determine the content-type from the file extension) and
mozilla will ignore it. this is the correct behaviour, but isn't the same way
as, for example, MS Internet Explorer works. see the release notes at
http://www.mozilla.org/releases/mozilla0.9.8/#devel
IMO this bug should be marked as INVALID.
![]() |
||
Comment 2•24 years ago
|
||
Andreas, please load the style sheet in the browser directly and type
javascript:alert(document.contentType)
in the URL bar. That will tell you what the server tells mozilla the type of
the file is.
Ok, thanks for the help.
I found out the same.
I included in the styles.php the following line
header ("Content-type: text/css");
and everything is fine.
When I submitted the "bug" I did not know that the type="text/css" in <link
rel=stylesheet href="styles.php" type="text/css"> is only an advisory hint as
you can read in
http://www.w3.org/TR/html401/struct/links.html#adef-type-A
I think too that the bug should be marked as invalid.
I'm sorry for the inconvenience.
Status: UNCONFIRMED → RESOLVED
Closed: 24 years ago
Resolution: --- → INVALID
Comment 5•19 years ago
|
||
*** Bug 335829 has been marked as a duplicate of this bug. ***
Comment 6•19 years ago
|
||
(In reply to comment #4)
> Verified invalid
>
Firefox 1.5.0.6 didn't have this problem (I seem to remember), but
Firefox 1.5.0.7 has it again!
Why should the browser be so unrobust, as to demand for a header type?
That's just doesn't sound like good engineering to me!
In particular: assume a host (http://www.kilu3.de in particular) who
1. does not provide PHP
2. has disabled the upload of files with .css extension
So you'll just have to rename the .css to .txt or .html or whatever and hope the browser treats it as css
(one could write a parser that checks for css, but that would be overkill)
(This should be REOPENED!)
![]() |
||
Comment 7•19 years ago
|
||
> Why should the browser be so unrobust, as to demand for a header type?
Because not all stylesheets are CSS.
> assume a host
I suggest getting a host that actually lets you put up what you want.
Comment 8•19 years ago
|
||
Why not trust the content-type hint in
<link rel="stylesheet" type="text/css" ...
when it is *explicitly* given!!
(Which other important stylesheets are there, that could be confused with CSS?)
-> http://stud4.tuwien.ac.at/~e0425408/css_problem/go.html
(note:
I do hope something is done about this!
Otherwise I'll it rest, after this round!)
![]() |
||
Comment 9•19 years ago
|
||
> Why not trust the content-type hint
Because the HTML spec explicitly says not to.
Note that in quirks mode we DO trust the hint. But if your page is in standards mode, you get standards behavior. This is all well documented in the quirks mode description. See <http://developer.mozilla.org/en/docs/Mozilla_Quirks_Mode_Behavior>.
You need to log in
before you can comment on or make changes to this bug.
Description
•