Re: [csswg-drafts] [css-nesting-1] Need to specify error-handling when writing selectors via OM (#7971)

https://drafts.csswg.org/cssom/#insert-a-css-rule throws in case of error:

> 2. If index is greater than length, then [throw](http://heycam.github.io/webidl/#dfn-throw) an [IndexSizeError](https://webidl.spec.whatwg.org/#indexsizeerror) exception.

> 4. If new rule is a syntax error, [throw](http://heycam.github.io/webidl/#dfn-throw) a [SyntaxError](https://webidl.spec.whatwg.org/#syntaxerror) exception.
> 5. If new rule cannot be inserted into list at the zero-index position index due to constraints specified by CSS, then [throw](http://heycam.github.io/webidl/#dfn-throw) a [HierarchyRequestError](https://webidl.spec.whatwg.org/#hierarchyrequesterror) exception.
> 6. If new rule is an `@namespace` at-rule, and list contains anything other than `@import` at-rules, and `@namespace` at-rules, [throw](http://heycam.github.io/webidl/#dfn-throw) an [InvalidStateError](https://webidl.spec.whatwg.org/#invalidstateerror) exception.

So I think it should be the same for nesting.

-- 
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7971#issuecomment-1294190976 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 27 October 2022 22:29:42 UTC