This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
I believe that the CSS Validatorhas a bug when it detects multiple @import directives. The CSS validator is giving me the following error message. Line: 18 Uncaught errorjava.lang.Exception: Import loop detected in http://www.d.umn.edu/~lcarlson/cssbug/ The full report is at: http://tinyurl.com/rldp In Eric Meyer's "Cascading Style sheets the Definitive Guide" page 15 he states, "...there can be more than one @import statement in a document." And the CSS below was valid previously. Has the validator changed? On the Web Design list (see forwarded message below) Sam Marshall gave some good insight into the bug and suggested that I contact you and report it. Can you please fix it? Thanks, Laura ---------- Forwarded Message ---------- Date: Monday, October 20, 2003 5:25 AM -0400 From: "[WD] digest" <owner-digest@webdesign-l.com> To: digest@webdesign-l.com Subject: [WD] digest V2 #1616 Since you don't have an infinite loop (none of your stylesheets have @imports except the main one), I would say this is probably a validator bug. Most likely the loop detection is failing because of one of two features: a) you have multiple imports in the <style> statement rather than in different .css files and it is confused as it doesn't know a 'name' for the style block .css 'file'. or b) your stylesheets have similar names until the last few characters (Both of these would indicate a validator bug, I'm just making vague guesses at why it might happen.) You might want to make a copy of your files somewhere that they won't change (so it's useful as a reference while fixing the bug) and submit it in a bug report to the validator people. Unless I'm being thick, there is no infinite loop anywhere in your page and even if there's something else wrong with your CSS, the validator shouldn't report an import loop when one doesn't exist. - --sam ---------- End Forwarded Message ----------
Yves Lafon, W3C has now fixed this bug. It happened when the validator was modified to avoid import loops that was taking all the resources of the machine.
Page attaches separate css files for print and screen media. Both print.css and screen.css @import a common file base.css. There are no other @import directives. CSSValidator reports "errorjava.lang.Exception: Import loop detected". (Pages previously validated without error.) Glen
Hi! I had the same problem as described above: two stylesheets (one for printing, one for the screen) that import the same stylesheet will produce the Exception. My solution, as long as this bug exists, so the docs will validate: <link rel="stylesheet" media="screen, print" type="text/css" href="base.css" /> <link rel="stylesheet" media="screen" type="text/css" href="screen.css" /> <link rel="stylesheet" media="print" type="text/css" href="print.css" /> So base.css is included in the media's print and screen without adding the @import line in the Stylesheets print.css and screen.css. This is more like an "import" in the (x)html file itself and should work as well. Perhaps it will help you... Stefan
The bug seems to be a simplistic definition of "loop". I suspect that the algorithm at fault is as follows. Repeat for each style sheet: 1. Record the style sheet's URI. 2. If the URI is the same as any URI recorded previously in this validation session, raise an error. 3. Get the style sheet. 4. Validate the style sheet. The following style sheet illustrates the validator's inability to handle a very finite situation: @import "http://www.w3.org/StyleSheets/home.css"; @import "http://www.w3.org/StyleSheets/home.css"; The validator's result: http://jigsaw.w3.org/css-validator/validator?text=%40import+%22http%3A%2F%2Fwww.w3.org%2FStyleSheets%2Fhome.css%22%3B%40import+%22http%3A%2F%2Fwww.w3.org%2FStyleSheets%2Fhome.css%22%3B&usermedium=all
*** Bug 754 has been marked as a duplicate of this bug. ***
Please check that it is ok on http://qa-dev.w3.org:8001/css-validator/ the "main" server will be updated later.