Welcome to WebmasterWorld Guest from 54.167.76.176

Forum Moderators: open

Message Too Old, No Replies

How Opera deals with trying to import non existent CSS files

Some very unusual behaviour!

     

BlobFisk

12:00 pm on May 31, 2007 (gmt 0)

WebmasterWorld Senior Member blobfisk is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I happened upon a very interesting Opera quirk that took a while to diagnose!

Due to interesting nuances with RPM (long story), a developer decided to add an @import link to a non-existent CSS file that would be included at a later date. During testing we saw some interesting results with the page rendering, things being positioned in the wrong place etc.

So, turning on Operas very nice Developer Console, I looked to see what was happening. Opera showed the CSS files it was asked to link to and there was the link to the non-existent file. However, when I clicked on the show rules button I saw some unexpected results!

I would have expected to see nothing, but instead I saw some CSS rules. These rules were coming from the Apache custom 404 page, which has some CSS in the head!

It seems that Opera, looking for a file (with content type text/css), received a 404 page which contained some text/css content which it applied to the page!

This seems like very odd behaviour. The W3C has no specification or recommendation on what user agents should do in the case of a linked CSS file not being present. IE and Firefox/Mozilla do nothing and accept the omission, Opera seems to be far more hungry with it's search for some CSS to pull in!

Now, I know that it is bad practise to try to link/import files which don't exist - and I have flogged the developer in question ;) - but is Opera doing the right thing here? Opera is excellent for standards adherence and forces us to be very exact with our code, but surely looking at the HTTP response, seeing 404 instead of 200, should have meant that it didn't try to seek for some, any CSS!

tedster

5:42 pm on May 31, 2007 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



That is some strange stuff!

I agree that the 404 should be enough for Opera to give up. Maybe it's a bug, and not a feature.

Mitchman

8:04 am on Jun 5, 2007 (gmt 0)

5+ Year Member



Sounds like a bug, or undesired behaviour perhaps. Please report it at [bugs.opera.com...]

Mitchman

8:08 am on Jun 5, 2007 (gmt 0)

5+ Year Member



According to QA, this has most likely been fixed for "kestrel" (next major release of Opera)

tedster

6:05 pm on Jun 5, 2007 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Thanks, Mitchman. It's nice to have someone here from behind the scenes at Opera.

BlobFisk

4:05 pm on Jun 6, 2007 (gmt 0)

WebmasterWorld Senior Member blobfisk is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Thanks Mitchman!

Logged it as a bug and really glad to hear that it's being fixed!

 

Featured Threads

Hot Threads This Week

Hot Threads This Month