Skip to content

Commit c5b0158

Browse files
upsuperzcorpan
authored andcommitted
[cssom] Check index for rule insertion first
Fixes #753.
1 parent 71b1797 commit c5b0158

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cssom/Overview.bs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,13 +1478,13 @@ To <dfn>serialize a CSS rule</dfn>, perform one of the following in accordance w
14781478

14791479
To <dfn>insert a CSS rule</dfn> <var>rule</var> in a CSS rule list <var>list</var> at index <var>index</var>, follow these steps:
14801480
<ol>
1481+
<li>Set <var>length</var> to the number of items in <var>list</var>.
1482+
<li>If <var>index</var> is greater than <var>length</var>, then <a>throw</a>
1483+
an {{IndexSizeError}} exception.
14811484
<li>Set <var>new rule</var> to the results of performing <a>parse a CSS rule</a>
14821485
on argument <var>rule</var>.
14831486
<li>If <var>new rule</var> is a syntax error, <a>throw</a>
14841487
a {{SyntaxError}} exception.
1485-
<li>Set <var>length</var> to the number of items in <var>list</var>.
1486-
<li>If <var>index</var> is greater than <var>length</var>, then <a>throw</a>
1487-
an {{IndexSizeError}} exception.
14881488
<li>If <var>new rule</var> cannot be inserted into <var>list</var> at the zero-index position <var>index</var> due to constraints
14891489
specified by CSS, then <a>throw</a>
14901490
a {{HierarchyRequestError}} exception. [[!CSS21]]

0 commit comments

Comments
 (0)