Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StylePropertyMap.set should throw on receiving a list for a single valued property #544

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 12 additions & 10 deletions css-typed-om/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -385,13 +385,17 @@ probably in an appendix.
5. If |props|[|property|] [=map/exists=],
[=map/remove=] it.

6. Let |values to set| be an empty [=list=].
6. If |property| is a single-valued property and |values| has more than
one |value| [=throw=] a {{TypeError}} and exit this algorithm.

7. For each |value| in |values|,
7. Let |values to set| be an empty [=list=].

8. For each |value| in |values|,
[=normalize a style value=] for |property| and |value|,
and append the result to |values to set|.

8. Set |props|[|property|] to |values to set|.

9. Set |props|[|property|] to |values to set|.

Note: The property is deleted then added back
so that it gets put at the end of the [=ordered map=],
Expand Down Expand Up @@ -2071,17 +2075,15 @@ is a [=list=] of {{CSSTransformComponent}}s.
when invoked,
perform the following steps:

1. If |x| or |y| don't match <<length-percentage>>,
1. If |x|, |y|, or |z| (if passed)
don't match <<length-percentage>>,
[=throw=] a {{TypeError}}.

2. If |z| was passed, but doesn't match <<length>>,
[=throw=] a {{TypeError}}.

3. Let |this| be a new {{CSSTranslate}} object,
2. Let |this| be a new {{CSSTranslate}} object,
with its {{CSSTranslate/x}} and {{CSSTranslate/y}} internal slots
set to |x| and |y|.

4. If |z| was passed,
3. If |z| was passed,
set |this|’s {{CSSTranslate/z}} internal slot
to |z|,
and set |this|’s {{CSSTransformComponent/is2D}} internal slot
Expand All @@ -2093,7 +2095,7 @@ is a [=list=] of {{CSSTransformComponent}}s.
and set |this|’s {{CSSTransformComponent/is2D}} internal slot
to `true`.

6. Return |this|.
5. Return |this|.
</div>

<div algorithm="CSSRotate(angle)">
Expand Down