Inserts a new rule into the style sheet.
HRESULT insertRule( BSTR bstrRule, long lIndex, long *plNewIndex );
- [in] The text that represents the rule, which must be able to be parsed. For rule sets, this specifies both the selector and the style declaration. For at-rules, this specifies both the at-identifier ("@rule_name") and the rule content.
- [in] The index within the style sheet's rule list of the rule before which to insert the specified rule. If the specified index equals the length of the style sheet's rule list, the rule will be added to the end of the style sheet.
- [out, retval] The newly inserted rule's index within the style sheet's rule list.
Returns one of the following values.
S_OK The operation completed successfully. W3CException_DOM_HIERARCHY_REQUEST_ERR The node cannot be inserted at the requested location. W3CException_DOM_INDEX_SIZE_ERR Index or size is negative, or greater than the allowed value. W3CException_DOM_NO_MODIFICATION_ALLOWED_ERR An attempt is made to modify an object that cannot be changed. W3CException_DOM_SYNTAX_ERR An invalid string value is specified.
After the new rule has been inserted, it becomes part of the cascade.