-
Notifications
You must be signed in to change notification settings - Fork 142
[css-typed-om] StylePropertMap.set for non-list properties #512
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
Labels
Comments
MXEBot
pushed a commit
to mirror/chromium
that referenced
this issue
Nov 23, 2017
Currently StylePropertyMaps don't support strings e.g. styleMap.set('width', CSS.px(1)) works, but styleMap.set('width', '1px') doesn't. This patch adds string support by moving parsing code to StyleValueFactory so that both CSSStyleValue.parse and StylePropertyMaps can share the parsing logic. We also do some refactoring to make handling both CSSStyleValue and strings easier. There are still some code paths that we're not sure is correct, pending clarification on GitHub: w3c/css-houdini-drafts#512 Spec: https://drafts.css-houdini.org/css-typed-om-1/#the-stylepropertymap Bug: 545318 Change-Id: Iaef3cfad69789fc115b7e98a296eec5cb4480cd8 Reviewed-on: https://chromium-review.googlesource.com/769797 Commit-Queue: Darren Shen <shend@chromium.org> Reviewed-by: nainar <nainar@chromium.org> Cr-Commit-Position: refs/heads/master@{#518443}
Actually, it just silently treats all properties as list-valued, even when they're not. This is still a bug tho - it's inconsistent with how .append() works on single-valued properties (it throws). We should be consistent here and just throw in both situations, so calling .set() on a single-valued property with more than one value should throw a TypeError. |
MXEBot
pushed a commit
to mirror/chromium
that referenced
this issue
Dec 15, 2017
When setting multiple values on a non list valued property, we resolved to throw a TypeError. Spec: w3c/css-houdini-drafts#512 Bug: 785132 Change-Id: I2a1a06ffc3eb6db66e08e2537eeaa570feaff0d3 Reviewed-on: https://chromium-review.googlesource.com/826744 Reviewed-by: nainar <nainar@chromium.org> Commit-Queue: Darren Shen <shend@chromium.org> Cr-Commit-Position: refs/heads/master@{#524182}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What should StylePropertyMap.set do for non-list properties when given multiple arguments? e.g.
According to the spec, the "property model" will contain an entry
("width", [1px, 2px, 3px])
. It's then unclear whatgetAll
should return. If we follow the spec strictly, we return[[1px, 2px, 3px]]
(a single-element list containing a 3-element list), which is probably not right... Shouldset
throw an exception or just set the first element?The text was updated successfully, but these errors were encountered: