@@ -361,7 +361,7 @@ export function _setDefaultCommitNativeUpdates(commit: unknown): void {
361361 * a commit apply it, right away when nothing is holding native updates back.
362362 */
363363function queueOrApplyNative ( view : ViewBase , store : any , property : NativeProperty , value : any , write : NativeWrite , oldValue : any ) : void {
364- if ( view . _suspendNativeUpdatesCount !== 0 || scheduler . _depth !== 0 || view . commitNativeUpdates !== defaultCommitNativeUpdates ) {
364+ if ( view . _suspendNativeUpdatesCount !== 0 || scheduler . _depth !== 0 || view . commitNativeUpdates !== defaultCommitNativeUpdates || property . invalidates !== undefined ) {
365365 queueNativeUpdate ( view , property , oldValue ) ;
366366
367367 return ;
@@ -392,11 +392,12 @@ function queueNativeUpdate(view: ViewBase, property: NativeProperty, oldValue: a
392392 scheduler . _hold ( view ) ;
393393 }
394394
395+ const invalidates = property . invalidates ;
395396 const dirty = view . _suspendedUpdates ;
396397 if ( dirty && view [ property . setNative ] ) {
397- // `NativeUpdateBatch.previous` is only reachable from a commit hook, so a node whose class
398- // does not define one records nothing.
399- if ( view . commitNativeUpdates !== defaultCommitNativeUpdates ) {
398+ // `NativeUpdateBatch.previous` is only reachable from a commit hook or an aggregate
399+ // handler, so a node with neither records nothing.
400+ if ( invalidates !== undefined || view . commitNativeUpdates !== defaultCommitNativeUpdates ) {
400401 let previous = view . _pendingPrevious ;
401402 if ( ! previous ) {
402403 previous = view . _pendingPrevious = new Map ( ) ;
@@ -409,6 +410,17 @@ function queueNativeUpdate(view: ViewBase, property: NativeProperty, oldValue: a
409410 dirty [ property . name ] = property ;
410411 }
411412
413+ if ( invalidates ) {
414+ let pending = view . _pendingInvalidations ;
415+ if ( ! pending ) {
416+ pending = view . _pendingInvalidations = new Set ( ) ;
417+ }
418+
419+ for ( let i = 0 , length = invalidates . length ; i < length ; i ++ ) {
420+ pending . add ( invalidates [ i ] ) ;
421+ }
422+ }
423+
412424 if ( view . _suspendNativeUpdatesCount === 0 ) {
413425 initNativeView ( view ) ;
414426 }
@@ -425,6 +437,7 @@ export class Property<T extends ViewBase, U> implements TypedPropertyDescriptor<
425437
426438 public readonly defaultValueKey : symbol ;
427439 public readonly defaultValue : U ;
440+ public readonly invalidates : readonly Invalidation [ ] | undefined ;
428441 public readonly nativeValueChange : ( owner : T , value : U ) => void ;
429442
430443 public isStyleProperty : boolean ;
@@ -453,6 +466,7 @@ export class Property<T extends ViewBase, U> implements TypedPropertyDescriptor<
453466
454467 const defaultValue : U = options . defaultValue ;
455468 this . defaultValue = defaultValue ;
469+ this . invalidates = options . invalidates ;
456470
457471 const eventName = propertyName + 'Change' ;
458472
@@ -787,6 +801,7 @@ export class CssProperty<T extends Style, U> {
787801 public readonly sourceKey : symbol ;
788802 public readonly defaultValueKey : symbol ;
789803 public readonly defaultValue : U ;
804+ public readonly invalidates : readonly Invalidation [ ] | undefined ;
790805
791806 public overrideHandlers : ( options : CssPropertyOptions < T , U > ) => void ;
792807
@@ -819,6 +834,7 @@ export class CssProperty<T extends Style, U> {
819834
820835 const defaultValue : U = options . defaultValue ;
821836 this . defaultValue = defaultValue ;
837+ this . invalidates = options . invalidates ;
822838
823839 const eventName = propertyName + 'Change' ;
824840 let affectsLayout : boolean = options . affectsLayout ;
@@ -1013,6 +1029,7 @@ export class CssAnimationProperty<T extends Style, U> implements CssAnimationPro
10131029 private readonly source : symbol ;
10141030
10151031 public readonly defaultValue : U ;
1032+ public readonly invalidates : readonly Invalidation [ ] | undefined ;
10161033
10171034 public isStyleProperty : boolean ;
10181035
@@ -1050,6 +1067,7 @@ export class CssAnimationProperty<T extends Style, U> implements CssAnimationPro
10501067 this . defaultValueKey = defaultValueKey ;
10511068
10521069 this . defaultValue = options . defaultValue ;
1070+ this . invalidates = options . invalidates ;
10531071
10541072 const cssValue = Symbol ( cssName ) ;
10551073 const styleValue = Symbol ( `local:${ propertyName } ` ) ;
0 commit comments