Merge branch 'lixinli_varcalc_0120' of https://gitee.com/superFat/third_party_weex-loader into lixinli_varcalc_0120

Signed-off-by: yaoyuchi <yaoyuchi@huawei.com>
This commit is contained in:
Li 2022-02-21 17:23:31 +08:00 committed by yaoyuchi
commit 96ffef7e79

View File

@ -3232,6 +3232,14 @@ function cssVarFun(value) {
function validate(name, value) {
saveCssProp(name, value)
var result, log
if (typeof value === 'string') {
if (value.match(/var/)) {
value = cssVarFun(value)
}
if (value.match(/calc/)) {
value = evalRpn(dal2Rpn(value))
}
}
var validator = validatorMap[name]
if (typeof validator === 'function') {
@ -3242,19 +3250,6 @@ function validate(name, value) {
/* istanbul ignore else */
else {
result = {value: value}
if (name != "border") {
var value = result.value.toString()
if (value.match(/var/)) {
value = cssVarFun(value)
}
if (value.match(/calc/)) {
value = dal2Rpn(value)
value = evalRpn(value)
} else {
value = value
}
result = {value: value}
}
}
if (result.reason) {
log = {reason: result.reason(name, value, result.value)}