CSSNumericValue

草案
此页面不完整。

这是 实验性技术
检查 浏览器兼容性表格 在生产中使用这之前。

CSSNumericValue interface of the CSS Typed Object Model API represents operations that all numeric values can perform.

Interfaces based on CSSNumericValue

Below is a list of interfaces based on the CSSNumericValue interface.

特性

None.

事件处理程序

No

方法

CSSNumericValue.add
Adds a supplied number to the CSSNumericValue .
CSSNumericValue.sub
Subtracts a supplied number from the CSSNumericValue .
CSSNumericValue.mul
Multiplies the CSSNumericValue by the supplied value.
CSSNumericValue.div
Divides the CSSNumericValue by the supplied value.
CSSNumericValue.min
Returns the minimum value passed
CSSNumericValue.max
Returns the maximum value passed
CSSNumericValue.equals
True if all the values are the exact same type and value, in the same order. Otherwise, false.
CSSNumericValue.to
转换 value into another one with the specified unit.
CSSNumericValue.toSum
TBD
CSSNumericValue.type
TBD
CSSNumericValue.parse
Allows a CSSNumericValue to be constructed directly from a string containing CSS.

规范

规范 状态 Comment
CSS Typed OM Level 1
The definition of 'CSSNumericValue' in that specification.
工作草案 初始定义。

浏览器兼容性

更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
CSSNumericValue
Chrome 66 Edge 79 Firefox No IE No Opera 53 Safari No WebView Android 66 Chrome Android 66 Firefox Android No Opera Android 47 Safari iOS No Samsung Internet Android 9.0
add
Chrome 66 Edge 79 Firefox No IE No Opera 53 Safari No WebView Android 66 Chrome Android 66 Firefox Android No Opera Android 47 Safari iOS No Samsung Internet Android 9.0
div
Chrome 66 Edge 79 Firefox No IE No Opera 53 Safari No WebView Android 66 Chrome Android 66 Firefox Android No Opera Android 47 Safari iOS No Samsung Internet Android 9.0
equals
Chrome 66 Edge 79 Firefox No IE No Opera 53 Safari No WebView Android 66 Chrome Android 66 Firefox Android No Opera Android 47 Safari iOS No Samsung Internet Android 9.0
max
Chrome 66 Edge 79 Firefox No IE No Opera 53 Safari No WebView Android 66 Chrome Android 66 Firefox Android No Opera Android 47 Safari iOS No Samsung Internet Android 9.0
min
Chrome 66 Edge 79 Firefox No IE No Opera 53 Safari No WebView Android 66 Chrome Android 66 Firefox Android No Opera Android 47 Safari iOS No Samsung Internet Android 9.0
mul
Chrome 66 Edge 79 Firefox No IE No Opera 53 Safari No WebView Android 66 Chrome Android 66 Firefox Android No Opera Android 47 Safari iOS No Samsung Internet Android 9.0
parse
Chrome 66
66
Not exposed to PaintWorklet.
Edge 79
79
Not exposed to PaintWorklet.
Firefox No IE No Opera 53
53
Not exposed to PaintWorklet.
Safari No WebView Android 66
66
Not exposed to PaintWorklet.
Chrome Android 66
66
Not exposed to PaintWorklet.
Firefox Android No Opera Android 47
47
Not exposed to PaintWorklet.
Safari iOS No Samsung Internet Android 9.0
9.0
Not exposed to PaintWorklet.
sub
Chrome 66 Edge 79 Firefox No IE No Opera 53 Safari No WebView Android 66 Chrome Android 66 Firefox Android No Opera Android 47 Safari iOS No Samsung Internet Android 9.0
to
Chrome 66 Edge 79 Firefox No IE No Opera 53 Safari No WebView Android 66 Chrome Android 66 Firefox Android No Opera Android 47 Safari iOS No Samsung Internet Android 9.0
toSum
Chrome 66 Edge 79 Firefox No IE No Opera 53 Safari No WebView Android 66 Chrome Android 66 Firefox Android No Opera Android 47 Safari iOS No Samsung Internet Android 9.0
type
Chrome 66 Edge 79 Firefox No IE No Opera 53 Safari No WebView Android 66 Chrome Android 66 Firefox Android No Opera Android 47 Safari iOS No Samsung Internet Android 9.0

图例

完整支持
完整支持
不支持
不支持
实验。期望将来行为有所改变。
实验。期望将来行为有所改变。
见实现注意事项。

另请参阅