// The object’s supported property indices are the numbers in the range zero to one less than the number of CSSRule objects represented by the collection.
// If there are no such CSSRule objects, then there are no supported property indices.
// 2. If index is greater than length, then throw an IndexSizeError exception.
if(index>length)
returnDOM::IndexSizeError::create("CSS rule index out of bounds.");
// NOTE: These steps don't apply since we're receiving a parsed rule.
// 3. Set new rule to the results of performing parse a CSS rule on argument rule.
// 4. If new rule is a syntax error, throw a SyntaxError exception.
// FIXME: 5. If new rule cannot be inserted into list at the zero-index position index due to constraints specified by CSS, then throw a HierarchyRequestError exception. [CSS21]
// FIXME: 6. If new rule is an @namespace at-rule, and list contains anything other than @import at-rules, and @namespace at-rules, throw an InvalidStateError exception.
// 7. Insert new rule into list at the zero-indexed position index.
// 2. If index is greater than or equal to length, then throw an IndexSizeError exception.
if(index>=length)
returnDOM::IndexSizeError::create("CSS rule index out of bounds.");
// 3. Set old rule to the indexth item in list.
auto&old_rule=m_rules[index];
// FIXME: 4. If old rule is an @namespace at-rule, and list contains anything other than @import at-rules, and @namespace at-rules, throw an InvalidStateError exception.
(void)old_rule;
// 5. Remove rule old rule from list at the zero-indexed position index.
m_rules.remove(index);
// FIXME: 6. Set old rule’s parent CSS rule and parent CSS style sheet to null.