You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Real properties are faster since we can cache the property lookup, ex.
element.styleMap.color// => JS VM can cache the lookup for color
It also lets the getter/setter cache the "color" => engine representation conversion where most (all?) engines convert to an enum as there's a specific method for every property.
Note we'd still need .get(name) and .set(name) to deal with custom properties, since we don't want to add more named getters, ex. map.get("--foo"). vs map["--foo"].
The disadvantage of this approach is that it means StyleMap has 400+ properties like CSSStyleDeclaration does, and every new CSS property is implicitly adding new properties. It also means if maps get a new method called "filter", and we wanted StyleMap to be really maplike, we'd end up colliding with CSS's filter property.
The CSS Working Group just discussed #310, and agreed to the following resolutions:
RESOLVED: using properties (issue #310) is moved to L2
The full IRC log of that discussion
<shane> Topic: https://github.com/w3c/css-houdini-drafts/issues/310
<dbaron> Github topic: https://github.com/w3c/css-houdini-drafts/issues/310
<fantasai> shane: I want to either say No or wait until level 2 to consider this
<fantasai> Rossen: I'd be fine for that
<fantasai> RESOLVED: using properties (issue #310) is moved to L2
Real properties are faster since we can cache the property lookup, ex.
It also lets the getter/setter cache the "color" => engine representation conversion where most (all?) engines convert to an enum as there's a specific method for every property.
Note we'd still need .get(name) and .set(name) to deal with custom properties, since we don't want to add more named getters, ex.
map.get("--foo").
vsmap["--foo"]
.The disadvantage of this approach is that it means StyleMap has 400+ properties like CSSStyleDeclaration does, and every new CSS property is implicitly adding new properties. It also means if maps get a new method called "filter", and we wanted StyleMap to be really maplike, we'd end up colliding with CSS's filter property.
@bzbarsky
The text was updated successfully, but these errors were encountered: