<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>8624</bug_id>
          
          <creation_ts>2010-01-04 11:47:58 +0000</creation_ts>
          <short_desc>Possibility not to provide a URL to validate CSS content using parseStyleElement</short_desc>
          <delta_ts>2010-01-04 11:47:58 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>CSSValidator</product>
          <component>Parser</component>
          <version>CSS Validator</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="fd">fd</reporter>
          <assigned_to name="This bug has no owner yet - up for the taking">dave.null</assigned_to>
          
          
          <qa_contact name="qa-dev tracking">www-validator-cvs</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>30377</commentid>
    <comment_count>0</comment_count>
    <who name="fd">fd</who>
    <bug_when>2010-01-04 11:47:58 +0000</bug_when>
    <thetext>Description
------
There may be cases when the URL of the CSS content that is to be validated is unknown or when it cannot be &quot;retrieved&quot;, 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 &quot;file://example.org&quot;. The code does not report any error when a &quot;file&quot; URL is used because it is used internally to represent &quot;direct input&quot; CSS content.

That is a bit awkward, in particular because the &quot;file&quot; 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 &quot;retrievable&quot;. 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.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>