mirror of
https://gitee.com/openharmony/third_party_weex-loader
synced 2024-11-23 07:20:51 +00:00
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:
commit
96ffef7e79
21
deps/weex-styler/lib/validator.js
vendored
21
deps/weex-styler/lib/validator.js
vendored
@ -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)}
|
||||
|
Loading…
Reference in New Issue
Block a user