fix(ivy): use proper sanitizer names (#25817)

Fixes #25816

PR Close #25817
This commit is contained in:
cexbrayat 2018-09-05 17:13:17 +02:00 committed by Igor Minar
parent 379e8c5e19
commit 21009b06a1
3 changed files with 19 additions and 17 deletions

View File

@ -253,7 +253,7 @@ describe('compiler compliance: styling', () => {
template: function MyComponent_Template(rf, $ctx$) {
if (rf & 1) {
$r3$.ɵelementStart(0, "div");
$r3$.ɵelementStyling(null, null, $r3$.ɵzss);
$r3$.ɵelementStyling(null, null, $r3$.ɵdefaultStyleSanitizer);
$r3$.ɵelementEnd();
}
if (rf & 2) {
@ -310,7 +310,7 @@ describe('compiler compliance: styling', () => {
template: function MyComponent_Template(rf, $ctx$) {
if (rf & 1) {
$r3$.ɵelementStart(0, "div", $e0_attrs$);
$r3$.ɵelementStyling(null, $e0_styling$, $r3$.ɵzss);
$r3$.ɵelementStyling(null, $e0_styling$, $r3$.ɵdefaultStyleSanitizer);
$r3$.ɵelementEnd();
}
if (rf & 2) {
@ -318,7 +318,7 @@ describe('compiler compliance: styling', () => {
$r3$.ɵelementStylingProp(0, 1, $ctx$.myWidth);
$r3$.ɵelementStylingProp(0, 2, $ctx$.myHeight);
$r3$.ɵelementStylingApply(0);
$r3$.ɵelementAttribute(0, "style", $r3$.ɵbind("border-width: 10px"), $r3$.ɵzs);
$r3$.ɵelementAttribute(0, "style", $r3$.ɵbind("border-width: 10px"), $r3$.ɵsanitizeStyle);
}
}
});
@ -369,7 +369,7 @@ describe('compiler compliance: styling', () => {
template: function MyComponent_Template(rf, ctx) {
if (rf & 1) {
$r3$.ɵelementStart(0, "div");
$r3$.ɵelementStyling(null, _c0, $r3$.ɵzss);
$r3$.ɵelementStyling(null, _c0, $r3$.ɵdefaultStyleSanitizer);
$r3$.ɵelementEnd();
}
if (rf & 2) {
@ -529,7 +529,7 @@ describe('compiler compliance: styling', () => {
}
if (rf & 2) {
$r3$.ɵelementAttribute(0, "class", $r3$.ɵbind("round"));
$r3$.ɵelementAttribute(0, "style", $r3$.ɵbind("height:100px"), $r3$.ɵzs);
$r3$.ɵelementAttribute(0, "style", $r3$.ɵbind("height:100px"), $r3$.ɵsanitizeStyle);
}
}
});

View File

@ -193,10 +193,12 @@ export class Identifiers {
};
// sanitization-related functions
static sanitizeHtml: o.ExternalReference = {name: 'ɵzh', moduleName: CORE};
static sanitizeStyle: o.ExternalReference = {name: 'ɵzs', moduleName: CORE};
static defaultStyleSanitizer: o.ExternalReference = {name: 'ɵzss', moduleName: CORE};
static sanitizeResourceUrl: o.ExternalReference = {name: 'ɵzr', moduleName: CORE};
static sanitizeScript: o.ExternalReference = {name: 'ɵzc', moduleName: CORE};
static sanitizeUrl: o.ExternalReference = {name: 'ɵzu', moduleName: CORE};
static sanitizeHtml: o.ExternalReference = {name: 'ɵsanitizeHtml', moduleName: CORE};
static sanitizeStyle: o.ExternalReference = {name: 'ɵsanitizeStyle', moduleName: CORE};
static defaultStyleSanitizer:
o.ExternalReference = {name: 'ɵdefaultStyleSanitizer', moduleName: CORE};
static sanitizeResourceUrl:
o.ExternalReference = {name: 'ɵsanitizeResourceUrl', moduleName: CORE};
static sanitizeScript: o.ExternalReference = {name: 'ɵsanitizeScript', moduleName: CORE};
static sanitizeUrl: o.ExternalReference = {name: 'ɵsanitizeUrl', moduleName: CORE};
}

View File

@ -102,10 +102,10 @@ export const angularCoreEnv: {[name: string]: Function} = {
'ɵembeddedViewStart': r3.embeddedViewStart,
'ɵembeddedViewEnd': r3.embeddedViewEnd,
zh': sanitization.sanitizeHtml,
zs': sanitization.sanitizeStyle,
zss': sanitization.defaultStyleSanitizer,
zr': sanitization.sanitizeResourceUrl,
zc': sanitization.sanitizeScript,
zu': sanitization.sanitizeUrl
sanitizeHtml': sanitization.sanitizeHtml,
sanitizeStyle': sanitization.sanitizeStyle,
defaultStyleSanitizer': sanitization.defaultStyleSanitizer,
sanitizeResourceUrl': sanitization.sanitizeResourceUrl,
sanitizeScript': sanitization.sanitizeScript,
sanitizeUrl': sanitization.sanitizeUrl
};