mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-14 10:01:08 +08:00
revert: "perf(core): avoid setting the same value to view properties" (#10618)
Revert "perf(core): avoid setting the same value to view properties (#10602)" This reverts commit 499fe8dc82db623550a38d3f91eb9f9252304e31.
This commit is contained in:

committed by
GitHub

parent
e92ef33885
commit
a320ca1fb3
@ -721,40 +721,25 @@ export class CssState {
|
||||
cssExpsProperties[property] = value;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (property in oldProperties) {
|
||||
const oldValue = oldProperties[property];
|
||||
|
||||
delete oldProperties[property];
|
||||
|
||||
if (oldValue === value) {
|
||||
// Skip unchanged values
|
||||
continue;
|
||||
}
|
||||
delete oldProperties[property];
|
||||
if (property in oldProperties && oldProperties[property] === value) {
|
||||
// Skip unchanged values
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isCssVariable(property)) {
|
||||
view.style.setScopedCssVariable(property, value);
|
||||
delete newPropertyValues[property];
|
||||
continue;
|
||||
}
|
||||
|
||||
valuesToApply[property] = value;
|
||||
}
|
||||
|
||||
// we need to parse CSS vars first before evaluating css expressions
|
||||
//we need to parse CSS vars first before evaluating css expressions
|
||||
for (const property in cssExpsProperties) {
|
||||
delete oldProperties[property];
|
||||
const value = evaluateCssExpressions(view, property, cssExpsProperties[property]);
|
||||
|
||||
if (property in oldProperties) {
|
||||
const oldValue = oldProperties[property];
|
||||
|
||||
delete oldProperties[property];
|
||||
|
||||
if (oldValue === value) {
|
||||
// Skip unchanged values
|
||||
continue;
|
||||
}
|
||||
if (property in oldProperties && oldProperties[property] === value) {
|
||||
// Skip unchanged values
|
||||
continue;
|
||||
}
|
||||
if (value === unsetValue) {
|
||||
delete newPropertyValues[property];
|
||||
@ -776,11 +761,9 @@ export class CssState {
|
||||
view[camelCasedProperty] = unsetValue;
|
||||
}
|
||||
}
|
||||
|
||||
// Set new values to the style
|
||||
for (const property in valuesToApply) {
|
||||
const value = valuesToApply[property];
|
||||
|
||||
try {
|
||||
if (property in view.style) {
|
||||
view.style[`css:${property}`] = value;
|
||||
|
Reference in New Issue
Block a user