refactor(compiler): move host properties into DirectiveWrapper
Part of #11683
This commit is contained in:
@ -328,7 +328,12 @@ export class DomElementSchemaRegistry extends ElementSchemaRegistry {
|
||||
* 'NONE' security context, i.e. that they are safe inert string values. Only specific well known
|
||||
* attack vectors are assigned their appropriate context.
|
||||
*/
|
||||
securityContext(tagName: string, propName: string): SecurityContext {
|
||||
securityContext(tagName: string, propName: string, isAttribute: boolean): SecurityContext {
|
||||
if (isAttribute) {
|
||||
// NB: For security purposes, use the mapped property name, not the attribute name.
|
||||
propName = this.getMappedPropName(propName);
|
||||
}
|
||||
|
||||
// Make sure comparisons are case insensitive, so that case differences between attribute and
|
||||
// property names do not have a security impact.
|
||||
tagName = tagName.toLowerCase();
|
||||
@ -366,4 +371,6 @@ export class DomElementSchemaRegistry extends ElementSchemaRegistry {
|
||||
return {error: false};
|
||||
}
|
||||
}
|
||||
|
||||
allKnownElementNames(): string[] { return Object.keys(this._schema); }
|
||||
}
|
||||
|
@ -6,12 +6,14 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {SchemaMetadata} from '@angular/core';
|
||||
import {SchemaMetadata, SecurityContext} from '@angular/core';
|
||||
|
||||
export abstract class ElementSchemaRegistry {
|
||||
abstract hasProperty(tagName: string, propName: string, schemaMetas: SchemaMetadata[]): boolean;
|
||||
abstract hasElement(tagName: string, schemaMetas: SchemaMetadata[]): boolean;
|
||||
abstract securityContext(tagName: string, propName: string): any;
|
||||
abstract securityContext(elementName: string, propName: string, isAttribute: boolean):
|
||||
SecurityContext;
|
||||
abstract allKnownElementNames(): string[];
|
||||
abstract getMappedPropName(propName: string): string;
|
||||
abstract getDefaultComponentElementName(): string;
|
||||
abstract validateProperty(name: string): {error: boolean, msg?: string};
|
||||
|
Reference in New Issue
Block a user