style element and/or @import broken?

VERIFIED FIXED

Status

Tech Evangelism Graveyard
English US
--
major
VERIFIED FIXED
17 years ago
3 years ago

People

(Reporter: Tim Stone, Assigned: Doron Rosenberg (IBM))

Tracking

Details

(URL)

(Reporter)

Description

17 years ago
It has been brought to my attention that my style sheet is not loading in
mozilla 0.9.7 for MacOS X. The code can be seen on the homepage (as referenced
above). Specifically, I have recoded my site to XHTML specs and have validated
it in both BBEdit and on W3C. No syntax errors are being reported.

Of note is that the style sheet was not broken in earlier versions. This can be
demonstrated in Netscape 6.2.x where the style sheet seems to import fine.

Also note the following code constructs fail:

	<style type="text/css" media="All">
        @import url("/css/petmystone.css");
	</style>

	<style type="text/css" media="All">
        @import "/css/petmystone.css";
	</style>

*** XHTML compliant spec ***

	<style type="text/css" media="All">
	/* <![CDATA[ */
	@import "/css/petmystone.css";
	/* ]]> */
	</style>


I also have noticed that the menu choice View | Use Stylesheet | None option is
permanently checked. Could this be the problem? I have not been able to unset
("uncheck") this option.

I think I have covered my experience with this issue and will be following up
with several friends on these ideas.

Regards,
Tim
Please read the release notes.. (section: What's New In This Release)

Mozilla is "Strict standards compliance mode." on your page:

C:\aa>wget http://www.petmystone.com//css/petmystone.css
--20:29:05--  http://www.petmystone.com/css/petmystone.css
           => `petmystone.css'
Connecting to www.petmystone.com:80... connected!
HTTP request sent, awaiting response... 200 OK
Length: 3,662 [text/plain]


wrong mime-type (should be [plain/CSS])

-> Invalid


Status: UNCONFIRMED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → INVALID
Summary: style element and/or @import broken? → style element and/or @import broken?
reopening and sending to evangelism to track the issue...
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
-->evang
Assignee: asa → doronr
Status: UNCONFIRMED → NEW
Component: Browser-General → US General
Ever confirmed: true
Product: Browser → Tech Evangelism
QA Contact: doronr → zach
Version: other → unspecified
invalid again !

BZ: This is the homepage from the reporter.
Status: NEW → RESOLVED
Last Resolved: 17 years ago17 years ago
Resolution: --- → INVALID
(Reporter)

Comment 5

17 years ago
Matti,

I'm going to reopen this bug. Reason: citation of the release notes appears invalid.

The release notes state:

    * 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.

My style declaration specifies "text/css". This is correct. So what are you
asking? I do not understand the reasoning behind changing it to "plain/CSS"...
the face value of this request does not make sense in light of the release notes.

Please elaborate and resolve.

Thanks.
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
(Reporter)

Comment 6

17 years ago
Okay... re-read Matti's comments. I think I understand the problem: My host is
serving the content type wrong. I will defer until I can confirm with the host
service. 

Thanks.

Tim
Status: REOPENED → RESOLVED
Last Resolved: 17 years ago17 years ago
Resolution: --- → LATER
please never use later...

Status: RESOLVED → REOPENED
Resolution: LATER → ---
Matti, this is why I left the bug open....

Tim, the issue is not with your HTML.  The HTML is correct.  The problem is that
when the server sends the stylesheet the data is reported by the server to be of
type text/plain.  So now mozilla is faced with two different types for the data
text/plain and text/css.  The text/plain one takes precedence, per the HTTP and
HTML specifications.  So in standards mode we don't load your sheet.  You can
easily test all this by removing the doctype line from your page, thus putting
it into quirks mode.  Once you do this the sheet will load.

So this is not a problem with any of _your_ code but rather a server
configuration issue.  The release notes list ways to try to address the server
configuration problem (the server you're using _is_ Apache, so the methods
described in the release notes are applicable).  You can test the current MIME
type the server is sending by loading
http://www.petmystone.com/css/petmystone.css in the main browser window and then
typing 'javascript:alert(document.contentType)' in the url bar.  You want the
result to be "text/css" (not plain/css as Matti says).  If the release note
solutions do not help (this would mean you are not the server maintainer), I
would suggest sending mail to the web server maintainer.  If you do so, please
comment in this bug; we would be quite happy to also contact the maintainer and
request that this server bug be fixed.

Thanks for you patience, and feel free to email me in private if the release
notes are not clear on what needs to be done to change the server setup. 
Hopefully we can get your page loading correctly in short order.

--Boris
(Reporter)

Comment 9

17 years ago
Thank you all for your informative posts. I have followed the workaround
suggestion as noted in the release notes and added a .htaccess file to my docs
directory on the host. Additionally, I have filed a support ticket with the
host, www.hostway.com, to resolve the issue by updating the httpd.conf to handle
"text/css" per the release notes.

Can I close this issue? I'm going to do so, let me know if this is out of line.

Again, thanks for the quick replies.

Regards,
Tim

PS: The release notes are fine. I had to re-read them in the context of the
server, not the client.
Status: REOPENED → RESOLVED
Last Resolved: 17 years ago17 years ago
Resolution: --- → FIXED
yes you can close this.

(fixed is correct for "tech envangelism":If your bug is in Browser/Mailnews you
should select "invalid/worksforme" (no Mozilla bug).
and please don't use "remind/later/closed"

btw: plain/css was a "typo"...

verified fixed :
--22:15:14--  http://www.petmystone.com/css/petmystone.css
           => `petmystone.css.1'
Connecting to www.petmystone.com:80... connected!
HTTP request sent, awaiting response... 200 OK
Length: 3,662 [text/css]


Thanks
  Matthias
Status: RESOLVED → VERIFIED
Tim, thanks for filing that support ticket!
Product: Tech Evangelism → Tech Evangelism Graveyard
You need to log in before you can comment on or make changes to this bug.