<?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>28533</bug_id>
          
          <creation_ts>2015-04-22 08:11:52 +0000</creation_ts>
          <short_desc>Authoring conformance for @charset</short_desc>
          <delta_ts>2015-05-06 17:54:51 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>CSS</product>
          <component>Syntax</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</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>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Simon Pieters">zcorpan</reporter>
          <assigned_to name="Tab Atkins Jr.">jackalmage</assigned_to>
          
          
          <qa_contact>public-css-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>119749</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2015-04-22 08:11:52 +0000</bug_when>
    <thetext>The current state of css-syntax is a bit unclear when it comes to authoring conformance for @charset.

http://dev.w3.org/csswg/css-syntax/#input-byte-stream does not say anything is a parse error/syntax error.

http://dev.w3.org/csswg/css-syntax/#parse-a-stylesheet removes the first rule if it&apos;s @charset.

So it seems to me the following stylesheet parses without errors:

@charset { LOL }
foo { }

This seems bad at least for CSS validators but maybe also browser devtools that log CSS errors.

Note that HTML has some authoring conformance requirements on &lt;meta charset&gt; that are not parse errors in the parser section: https://html.spec.whatwg.org/multipage/semantics.html#character-encoding-declaration</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119888</commentid>
    <comment_count>1</comment_count>
    <who name="Tab Atkins Jr.">jackalmage</who>
    <bug_when>2015-04-24 17:16:33 +0000</bug_when>
    <thetext>So I guess some authoring conformance criteria along the lines of &quot;it&apos;s invalid to write a @charset rule that doesn&apos;t get recognized by the algorithm in this section&quot; in #input-byte-stream?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120139</commentid>
    <comment_count>2</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2015-05-06 17:54:51 +0000</bug_when>
    <thetext>That&apos;s a bit vague, and maybe not helpful enough for implementors wanting accurate errors in the console. e.g. what about @charset &quot;utf-16&quot;; ? is whitespace in the string OK? What if HTTP charset is given and @charset says a different encoding? etc.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>