
committed by
Miško Hevery

parent
9afc9a7464
commit
e76a570908
@ -8,7 +8,6 @@
|
||||
|
||||
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';
|
||||
|
||||
@ -388,7 +387,7 @@ export function renderStyling(
|
||||
context: StylingContext, renderer: Renderer3, styleStore?: {[key: string]: any},
|
||||
classStore?: {[key: string]: boolean}) {
|
||||
if (isContextDirty(context)) {
|
||||
const native = context[StylingIndex.ElementPosition] !.native;
|
||||
const native = context[StylingIndex.ElementPosition] !;
|
||||
const multiStartIndex = getMultiStartIndex(context);
|
||||
const styleSanitizer = getStyleSanitizer(context);
|
||||
for (let i = StylingIndex.SingleStylesStartPosition; i < context.length;
|
||||
|
@ -10,8 +10,8 @@ import {StyleSanitizeFn} from '../../sanitization/style_sanitizer';
|
||||
import {getContext} from '../context_discovery';
|
||||
import {ACTIVE_INDEX, LContainer} from '../interfaces/container';
|
||||
import {LContext} from '../interfaces/context';
|
||||
import {LElementNode} from '../interfaces/node';
|
||||
import {PlayerContext} from '../interfaces/player';
|
||||
import {RElement} from '../interfaces/renderer';
|
||||
import {InitialStyles, StylingContext, StylingIndex} from '../interfaces/styling';
|
||||
import {FLAGS, HEADER_OFFSET, HOST, LViewData} from '../interfaces/view';
|
||||
import {getTNode} from '../util';
|
||||
@ -20,7 +20,7 @@ export const EMPTY_ARR: any[] = [];
|
||||
export const EMPTY_OBJ: {[key: string]: any} = {};
|
||||
|
||||
export function createEmptyStylingContext(
|
||||
element?: LElementNode | null, sanitizer?: StyleSanitizeFn | null,
|
||||
element?: RElement | null, sanitizer?: StyleSanitizeFn | null,
|
||||
initialStylingValues?: InitialStyles): StylingContext {
|
||||
return [
|
||||
null, // PlayerContext
|
||||
@ -41,10 +41,10 @@ export function createEmptyStylingContext(
|
||||
* (instructions.ts has logic for caching this).
|
||||
*/
|
||||
export function allocStylingContext(
|
||||
lElement: LElementNode | null, templateStyleContext: StylingContext): StylingContext {
|
||||
element: RElement | null, templateStyleContext: StylingContext): StylingContext {
|
||||
// each instance gets a copy
|
||||
const context = templateStyleContext.slice() as any as StylingContext;
|
||||
context[StylingIndex.ElementPosition] = lElement;
|
||||
context[StylingIndex.ElementPosition] = element;
|
||||
return context;
|
||||
}
|
||||
|
||||
@ -61,12 +61,12 @@ export function allocStylingContext(
|
||||
*/
|
||||
export function getStylingContext(index: number, viewData: LViewData): StylingContext {
|
||||
let storageIndex = index + HEADER_OFFSET;
|
||||
let slotValue: LContainer|LViewData|StylingContext|LElementNode = viewData[storageIndex];
|
||||
let slotValue: LContainer|LViewData|StylingContext|RElement = viewData[storageIndex];
|
||||
let wrapper: LContainer|LViewData|StylingContext = viewData;
|
||||
|
||||
while (Array.isArray(slotValue)) {
|
||||
wrapper = slotValue;
|
||||
slotValue = slotValue[HOST] as LViewData | StylingContext | LElementNode;
|
||||
slotValue = slotValue[HOST] as LViewData | StylingContext | RElement;
|
||||
}
|
||||
|
||||
if (isStylingContext(wrapper)) {
|
||||
|
Reference in New Issue
Block a user