Closed Bug 149626 Opened 23 years ago Closed 22 years ago

CSS not or not correctly used for rendering a page

Categories

(Core :: CSS Parsing and Computation, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: maillists, Assigned: dbaron)

References

()

Details

From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.0) Gecko/20020530 BuildID: 2002053012 This URL consists of 4 framed pages. The page at the bottom left (coming from a different server) is rendered with correct font color and family. The font-family and colors on the other pages are not rendered correctly. Also, page margins are getting ignored. Reproducible: Always Steps to Reproduce: Load http://www.conactive.com. Actual Results: see description above, page at bottom left shows correctly, others do not. The fonts are rendered in the default font instead of Verdana, there is no left margin for the tables, the H2 header on the main page is in white (invisible) instead of blue. Expected Results: The text should all be rendered in Verdana or at least sans-serif, the H2 header should display in white and there should be a small margin on the left of the table. There should also be a 5px left-margin for the DIV on the navigation page. I think this page should be rendered in "standards mode" according to the doctype. Anyway, changing to other suggested doctypes or removing it doesn't change the behavior. I also made all style sheets to be served as mime-type text/css, although the "transitional" doctype shouldn't require this, this didn't change it either. It looks like the style sheet isn't applied at all. However, I can't see a viable difference to the styles and style sheet applied to the bottom left frame.
Not a DOM problem, over to style system for further investigation.
Assignee: jst → dbaron
Component: DOM Style → Style System
http://www.conactive.com/style/main.css has a few errors: * colors without '#' on lines 9 and 30 * ".9" as a class selector on line 37, even though identifiers can't start with numbers without being escaped Do these explain the problems?
David, thank you for pointing out the errors in the style sheet, I have corrected them. It's a quite old one, four or five years old and was only tweaked now and then, no real overhaul. But no, these mistakes do not explain the problem. However, I found the source of this problem: I changed the path from "../directory/file" to "/directory/file" and now the page displays almost identical to what IE displays. So, my first assumption was correct that it didn't apply the style sheet at all. A relative path is a valid HREF/URI, so I would consider this a bug.
What I see on the page right now is similar to what I saw this morning.
The big questions then is: what do you see? ;-) Either you have a caching problem or you have seen it in the morning correctly, in that case the problem is build or OS-specific (assuming you use either a different build or OS). Do you see the same layout you see with IE6 or if you cannot use IE6, do you get what I explained as expected behavior? (Verdana Font, visible headlines, margin left of the table)
One more: you have to reload the page. Just going to it in a new window isn't enough if Mozilla is set to default behavior (which is "refresh only when expired" or so). I see that on my other machine, there's no change although I loaded the page in a newly launched window, you need to reload.
Can you make a small testcase? I'm having great difficulty working out what is going on and what isn't...
I'm puzzled, I have the same problem as you, Ian. Let me recapitulate what I did yesterday. I installed Mozilla 1.0 (the first time ever), I fired it up and went to "www.conactive.com" to test if the pages display as intended. Ok, the pages displayed horribly, apparently no style sheet was used. So I did some testing and after I couldn't figure out why this could happen (I checked references, mozilla.org, deja.com etc.) I submitted the bug report. After getting the first statement from David I corrected the errors and reloaded. There was no change. Then I made a small test page (http://www.conactive.com/pages/test.htm) by removing all unnecessary stuff. This page displayed wrong as well. Then I changed the <LINK REL="STYLESHEET" TYPE="text/css" HREF="../style/test.css"> to <LINK REL="STYLESHEET" TYPE="text/css" HREF="/style/test.css"> Suddenly the page displayed correctly. I then applied the same changes to the conactive.com pages and they displayed fine after this as well. I also changed this back to "../" and Mozilla displayed the page again without the style sheet. So it was clear that it wasn't using the style sheet when referenced with a relative URI. I then submitted my comments. Now, today, I went again to http://www.conactive.com/pages/test.htm and it still displays correctly with "../" - not like yesterday. I changed the pages at conactive.com back to "../" and they still display correctly. I do not understand this. I *swear* that Mozilla didn't show the pages yesterday correctly before my small change. From two PCs I installed it on and tried. I can't reproduce this today. I deleted the cache. I also checked our server log of yesterday and it shows that the very first of my Mozilla requests asked for the style sheets. So, they were fetched but not used yesterday. I'm able to force it a bit to behave like yesterday but this is not the same situation I had yesterday. How can I make it behave like that? I delete the style sheet on the server and then refresh. Correctly, Mozilla displays the page without the style sheet. Then I copy the style sheet to the server again and refresh. The page remains displayed *without* the style sheet. For this I have some proof: [Fri Jun 7 21:16:12 2002] [error] File does not exist: /usr/local/etc/httpd/htdocs/conactive.com/style/test1.css [Fri Jun 7 21:16:12 2002] [error] Custom response error status was: 404 195.211.169.212 - - [07/Jun/2002:21:16:12 +0200] "GET /style/test1.css HTTP/1.0" 404 848 "http://www.conactive.com/pages/test-bug.htm" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.0) Gecko/20020530" 195.211.169.212 - - [07/Jun/2002:21:16:15 +0200] "GET /pages/test-bug.htm HTTP/1.0" 304 - "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.0) Gecko/20020530" 195.211.169.212 - - [07/Jun/2002:21:16:28 +0200] "GET /pages/test-bug.htm HTTP/1.0" 304 - "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.0) Gecko/20020530" 195.211.169.212 - - [07/Jun/2002:21:16:45 +0200] "GET /pages/test-bug.htm HTTP/1.0" 304 - "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.0) Gecko/20020530" 195.211.169.212 - - [07/Jun/2002:21:16:48 +0200] "GET /pages/test-bug.htm HTTP/1.0" 304 - "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.0) Gecko/20020530" 195.211.169.212 - - [07/Jun/2002:21:16:49 +0200] "GET /pages/test-bug.htm HTTP/1.0" 304 - "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.0) Gecko/20020530" 195.211.169.212 - - [07/Jun/2002:21:16:52 +0200] "GET /pages/test-bug.htm HTTP/1.0" 304 - "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.0) Gecko/20020530" The first paragraph is from the error log. It shows that Mozilla discovered that the style sheet isn't there. The next paragraph shows the corresponding request to the style sheet and the next lines show that *all* subsequent requests for the page did *not* ask for the missing style sheet again. Possibly because it misinterprets the 304 "page not modified". So, in this restricted test context I *can* reproduce this. And you should as well. However I can't with the pages I used yesterday. I'm puzzled. Anyway, there *was* something which prohibited display until I changed to the absolute LINK paths.
So are you suggesting that this is an HTTP bug, or perhaps a bug with your HTTP server? (Which server?)
No, not a bug in http protocol or with the server. I cannot reproduce today the bug I reported yesterday. I just installed Mozilla on a third machine and tested with a backup of the original pages (containing all errors etc.). It displays just fine. I don't understand this. Since I tried so many ways to repro it I don't know what should try As for the other problem I found today. Yes, this is reproducable and I think this is a bug in Mozilla (not in the http protocol or on the server-side). If Mozilla can't get a style sheet and I refresh it never asks again for this file until the html page linking to it gets changed. This behavior assumes that if an html page didn't change the linked style sheet wasn't changed either. I think this behavior isn't correct. Should I bug this with a new submission?
Please file a new bug with a small reproducible test case if possible. Thanks.
reporter (Kai): can you reproduce this bug with a recent build of mozilla (for example, 1.2)? if so, please comment again with details. if not, please resolve this bug as WORKSFORME. thanks.
The original bug was that Mozilla didn't apply the style sheet from a relative path. I can't repro this anymore, it works fine. There are still differences between the display in IE and Mozilla but it's probably beyond my knowledge of CSS and HTML which one of them is wrong. So, yes, it's ok.
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.