diff --git a/packages/core/src/render3/styling/class_and_style_bindings.ts b/packages/core/src/render3/styling/class_and_style_bindings.ts index d380b25177..9bdf68c6b8 100644 --- a/packages/core/src/render3/styling/class_and_style_bindings.ts +++ b/packages/core/src/render3/styling/class_and_style_bindings.ts @@ -7,12 +7,13 @@ */ import {StyleSanitizeFn} from '../../sanitization/style_sanitizer'; - import {InitialStylingFlags} from '../interfaces/definition'; import {LElementNode} from '../interfaces/node'; import {Renderer3, RendererStyleFlags3, isProceduralRenderer} from '../interfaces/renderer'; import {InitialStyles, StylingContext, StylingFlags, StylingIndex} from '../interfaces/styling'; -import {createEmptyStylingContext, EMPTY_ARR, EMPTY_OBJ} from './util'; + +import {EMPTY_ARR, EMPTY_OBJ, createEmptyStylingContext} from './util'; + /** * Used clone a copy of a pre-computed template of a styling context. @@ -240,7 +241,7 @@ export function updateStylingMap( // there is no point in setting this to dirty if the previously // rendered value was being referenced by the initial style (or null) - if (initialValue !== newValue) { + if (hasValueChanged(flag, initialValue, newValue)) { setDirty(context, ctxIndex, true); dirty = true; } @@ -252,10 +253,10 @@ export function updateStylingMap( const valueToCompare = getValue(context, indexOfEntry); const flagToCompare = getPointers(context, indexOfEntry); swapMultiContextEntries(context, ctxIndex, indexOfEntry); - if (valueToCompare !== newValue) { + if (hasValueChanged(flagToCompare, valueToCompare, newValue)) { const initialValue = getInitialValue(context, flagToCompare); setValue(context, ctxIndex, newValue); - if (initialValue !== newValue) { + if (hasValueChanged(flagToCompare, initialValue, newValue)) { setDirty(context, ctxIndex, true); dirty = true; } @@ -346,7 +347,7 @@ export function updateStyleProp( // if the value is the same in the multi-area then there's no point in re-assembling const valueForMulti = getValue(context, indexForMulti); - if (!valueForMulti || valueForMulti !== value) { + if (!valueForMulti || hasValueChanged(currFlag, valueForMulti, value)) { let multiDirty = false; let singleDirty = true; diff --git a/packages/core/test/render3/styling/core_player_handler_spec.ts b/packages/core/test/render3/styling/core_player_handler_spec.ts index b9ac3ad12c..c6bce3ac5c 100644 --- a/packages/core/test/render3/styling/core_player_handler_spec.ts +++ b/packages/core/test/render3/styling/core_player_handler_spec.ts @@ -5,8 +5,9 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ -import {CorePlayerHandler} from '../../../src/render3/styling/core_player_handler'; import {PlayState} from '../../../src/render3/interfaces/player'; +import {CorePlayerHandler} from '../../../src/render3/styling/core_player_handler'; + import {MockPlayer} from './mock_player'; describe('CorePlayerHandler', () => { diff --git a/packages/core/test/render3/styling/players_spec.ts b/packages/core/test/render3/styling/players_spec.ts index 60839b8248..6c2d235322 100644 --- a/packages/core/test/render3/styling/players_spec.ts +++ b/packages/core/test/render3/styling/players_spec.ts @@ -7,13 +7,13 @@ */ import {RenderFlags} from '@angular/core/src/render3'; -import {addPlayer, getPlayers} from '../../../src/render3/player'; -import {getOrCreatePlayerContext} from '../../../src/render3/styling/util'; import {QUERY_READ_FROM_NODE, defineComponent, getHostElement} from '../../../src/render3/index'; import {element, elementEnd, elementStart, elementStyling, elementStylingApply, load, markDirty} from '../../../src/render3/instructions'; -import {PlayerContext, PlayState, Player, PlayerHandler} from '../../../src/render3/interfaces/player'; +import {PlayState, Player, PlayerContext, PlayerHandler} from '../../../src/render3/interfaces/player'; import {RElement} from '../../../src/render3/interfaces/renderer'; +import {addPlayer, getPlayers} from '../../../src/render3/player'; import {QueryList, query, queryRefresh} from '../../../src/render3/query'; +import {getOrCreatePlayerContext} from '../../../src/render3/styling/util'; import {ComponentFixture} from '../render_util'; import {MockPlayer} from './mock_player';