As part of our css devtools we need a way to check that a css property value is valid. This is used to validate the value onkeyup. Our current solution is to call the following method on each keypress:
let name = this.prop.name;
let value = typeof aValue == "undefined" ? this.prop.value : aValue;
let style = this.doc.createElementNS(HTML_NS, "div").style;
style.setProperty(name, value, null);
The problem with this solution is that it spews css error messages for invalid property values, but we could work around this with:
It occurs to me that we are also adding autocomplete to the properties, so can any of you guys think of:
1. A better way to validate css property values.
2. A way to get a list of possible property values for a given css property (this could be used for autocomplete and validation).
3. A better way to do both 1 and 2 ;o)