Closed
Bug 184113
Opened 22 years ago
Closed 22 years ago
type="text/css" in link tag being overridden by content type sent by server
Categories
(Core :: DOM: CSS Object Model, defect)
Tracking
()
VERIFIED
INVALID
People
(Reporter: mozilla, Assigned: jst)
References
Details
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2.1) Gecko/20021130
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2.1) Gecko/20021130
When browsing a page with an external stylesheet link quoting a type of text/css
e.g.
<link rel="stylesheet" href="/weblog/styles-site.css" type="text/css" />
If the server does not have a content type definition for .css files and
downloads the styles-site.css with a default content type of text/plain, then
the contents of the stylesheet are completely ignored as the type declaration
from the link tag is being ignored.
Reproducible: Always
Steps to Reproduce:
1. Copy a stylesheet into a .txt file - say stylesheet.txt
2. Create a html page with a suitable stylesheet link tag, eg:
<link rel="stylesheet" href="stylesheet.txt" type="text/css" />
3. Load the html page into Mozilla, and check the Page Info dialog bog to see
whether the content type for the stylesheet has been recognised as text/css as
per the type= entry in the link tag.
Actual Results:
Stylesheet contents were ignored.
Page info said content type of the stylesheet ink was text/plain.
Expected Results:
Recognised the stylesheet contents and rendered accordingly.
Page info should say content type of the stylesheet link is text/css.
Comment 1•22 years ago
|
||
-> invalid
Mozilla accepts wrong mime-types for a css only if the html use quircks mode.
From the release notes:
When a page using a strict document type declaration (e.g. HTML 4.01 Strict)
links to an external style sheet (using <link>, @import, etc.) Mozilla will load
the style sheet only if it is served with a MIME type of "text/css". Style
sheets served with other MIME types, like text/plain, application/x-pointplus,
etc. will not be loaded. To add the proper CSS MIME type to an Apache web
servers, add "text/css css" to the system mime.types file. Or if you can't do
that, add "AddType text/css .css" to your .htaccess file.
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → INVALID
Comment 2•22 years ago
|
||
Verified. From http://www.w3.org/TR/html401/struct/objects.html#edef-OBJECT:
type = content-type [CI]
This attribute specifies the content type for the data specified by data.
This attribute is optional but recommended when data is specified since it
allows the user agent to avoid loading information for unsupported content
types. If the value of this attribute differs from the HTTP Content-Type
returned by the server when the object is retrieved, the HTTP Content-Type
takes precedence.
Status: RESOLVED → VERIFIED
*** Bug 198564 has been marked as a duplicate of this bug. ***
You need to log in
before you can comment on or make changes to this bug.
Description
•