<?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>17520</bug_id>
          
          <creation_ts>2012-06-16 22:44:04 +0000</creation_ts>
          <short_desc>does not specify how to handle multiple rules on insertRule</short_desc>
          <delta_ts>2013-08-08 13:26:31 +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>CSSOM</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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="Andrew Hushbeck">hushbeck</reporter>
          <assigned_to name="Simon Pieters">zcorpan</assigned_to>
          <cc>dbaron</cc>
    
    <cc>zcorpan</cc>
          
          <qa_contact>public-css-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>69157</commentid>
    <comment_count>0</comment_count>
    <who name="Andrew Hushbeck">hushbeck</who>
    <bug_when>2012-06-16 22:44:04 +0000</bug_when>
    <thetext>When doing an insertRule call on a CSSStyleSheet, the spec does not specify what to do if the rule contains multiple valid rules. It simple says:

    Parse rule.

    If parsing failed terminate these steps.

With multiple valid rules, theoretically parsing will succeed, but there is no indication if it is valid to have multiple rules in the string. Currently, IE 9, Chrome 19, and Opera 11.6 throw SYNTAX_ERR, whereas Firefox only inserts the first rule into the page.

This should probably be clarified to throw an error if more than 1 rule exists.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82832</commentid>
    <comment_count>1</comment_count>
    <who name="L. David Baron (Mozilla)">dbaron</who>
    <bug_when>2013-02-09 06:46:37 +0000</bug_when>
    <thetext>Quoting the css3-conditional disposition of comments (so far) on the analogous issue in that spec:

Issue 5:
Issue in spec about insertRule, followup to Issue 7
also raised as first issue in http://lists.w3.org/Archives/Public/www-style/2013Feb/0228.html
Raised by: David Baron, Florian Rivoal
Proposed resolution: http://lists.w3.org/Archives/Public/www-style/2013Feb/0229.html
Florian agrees: http://lists.w3.org/Archives/Public/www-style/2013Feb/0228.html
Edited: http://lists.w3.org/Archives/Public/www-style/2013Feb/0256.html
(Commenter agrees, of course.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82833</commentid>
    <comment_count>2</comment_count>
    <who name="L. David Baron (Mozilla)">dbaron</who>
    <bug_when>2013-02-09 06:47:12 +0000</bug_when>
    <thetext>(And I&apos;m changing Firefox&apos;s behavior in https://bugzilla.mozilla.org/show_bug.cgi?id=765599 .)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89951</commentid>
    <comment_count>3</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2013-06-27 12:58:25 +0000</bug_when>
    <thetext>This was fixed as part of integration with css-syntax. If you have multiple rules, css-syntax returns a syntax error:

[[
If the current input token is an 〈EOF〉, return the rule obtained in step 2. Otherwise, return a syntax error.
]]
http://dev.w3.org/csswg/css-syntax/#parse-a-rule0

and CSSOM then throws SyntaxError:

[[
If new rule is a syntax error, throw a SyntaxError exception.
]]
http://dev.w3.org/csswg/cssom/#insert-a-css-rule</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>