Open aeromac opened 10 months ago
Elemental takes these from Closure (specifically https://github.com/google/closure-compiler/blob/e6957b2a68b522a2483ab268cd835b8c706aca36/externs/browser/w3c_css.js#L1734 is a string
and other properties are number|string
, which gets converted to *UnionType when generating the Java code). This changed in https://github.com/google/closure-compiler/commit/7bd79871e81d1115fcb44800d98eb918e2630e20 , but I couldn't find any more info. You can ask the Closure community :shrug:
This is to avoid bugs. Although it's valid to assign 0 to element.style.left/right/top/bottom, any other numbers without units are silently ignored.
And I think they should do the same for others properties with unit, but it may break too many internal code.
Reopening the issue, the Closure extern file could could be improved.
Hi, I was just wondering why properties such as Width use types such as WidthUnionType which allows setting a double or String, however, Left does not have a similar type and is instead declared as a String type.
Thank you