Skip to content

Commit d3ab04d

Browse files
nainartabatkins
authored andcommitted
StylePropertyMap.set should throw when setting multiple values to non list prop (#599)
* StylePropertyMap.set should throw when setting multiple values to non list property Fixes #512 * Swap to a positive term.
1 parent 312e314 commit d3ab04d

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

css-typed-om/Overview.bs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -377,18 +377,21 @@ probably in an appendix.
377377
2. If |property| is not a [=supported property name=],
378378
[=throw=] a {{TypeError}} and exit this algorithm.
379379

380-
3. Let |props| be |this|’s [=StylePropertyMap/map entries=].
380+
3. If |property| is a [=single-valued property=] and |values| has more than one [=list/entry=],
381+
[=throw=] a {{TypeError}} and exit this algorithm.
381382

382-
4. If |props|[|property|] [=map/exists=],
383+
4. Let |props| be |this|’s [=StylePropertyMap/map entries=].
384+
385+
5. If |props|[|property|] [=map/exists=],
383386
[=map/remove=] it.
384387

385-
5. Let |values to set| be an empty [=list=].
388+
6. Let |values to set| be an empty [=list=].
386389

387-
6. For each |value| in |values|,
390+
7. For each |value| in |values|,
388391
[=normalize a style value=] for |property| and |value|,
389392
and append the result to |values to set|.
390393

391-
7. Set |props|[|property|] to |values to set|.
394+
8. Set |props|[|property|] to |values to set|.
392395

393396
Note: The property is deleted then added back
394397
so that it gets put at the end of the [=ordered map=],

0 commit comments

Comments
 (0)