[Bug 8624] New: Possibility not to provide a URL to validate CSS content using parseStyleElement

http://www.w3.org/Bugs/Public/show_bug.cgi?id=8624

           Summary: Possibility not to provide a URL to validate CSS content
                    using parseStyleElement
           Product: CSSValidator
           Version: CSS Validator
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Parser
        AssignedTo: dave.null@w3.org
        ReportedBy: fd@w3.org
         QAContact: www-validator-cvs@w3.org


Description
------
There may be cases when the URL of the CSS content that is to be validated is
unknown or when it cannot be "retrieved", e.g. because the CSS content is the
result of a copy and paste (typically the case when a direct input method is
available) or because it uses a URI scheme that Java is unaware of.

org.w3c.css.css.StyleSheetParser.StyleSheetParser#parseStyleElement expects a
URL to be always provided as a parameter. It uses that URL as the base URI to
resolve @import rules that may appear in the CSS content and further retrieve
additional content.

The only way to validate CSS content that got extracted from a non-URL source
is to provide the method with a fake URL of the form "file://example.org". The
code does not report any error when a "file" URL is used because it is used
internally to represent "direct input" CSS content.

That is a bit awkward, in particular because the "file" scheme should not be
treated in any specific way by the CSS validator. It is perfectly valid to use
it to identify and locate an HTML page and/or CSS content on the Web.


Suggested functionality
-----
There should be a way to validate CSS content without having to provide a URL.
The CSS validator may return a warning when it encounters URLs in the CSS
content that it cannot resolve in that case.

Alternatively, if the CSS validator needs an identifier to be provided,
consider accepting a URI instead of a URL, as URIs do not need to be
"retrievable". The CSS validator could still attempt to convert the URI to a
URL to resolve imports and report a warning when that cannot be done.


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Monday, 4 January 2010 11:47:59 UTC