fix(ivy): introduce host-specific styling instructions (#29292)
This patch is the first of a few patches which separates the styling logic between template bindings (e.g. <div [style]) from host bindings (e.g. @HostBinding('style')). This patch in particular introduces a series of host-specific styling instructions and changes the existing set of template styling instructions not to accept directives. The underyling code (which communicates with the styling algorithm) still works as it did before. This PR also separates the styling instruction code into a separate file and moves over all other instructions into an dedicated instructions directory. PR Close #29292
This commit is contained in:
@ -5,7 +5,7 @@
|
||||
* 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 {Directive, DoCheck, Input, ɵRenderFlags, ɵdefineDirective, ɵelementStyling, ɵelementStylingApply, ɵelementStylingMap} from '@angular/core';
|
||||
import {Directive, DoCheck, Input, ɵRenderFlags, ɵdefineDirective, ɵelementHostStyling, ɵelementHostStylingApply, ɵelementHostStylingMap} from '@angular/core';
|
||||
|
||||
import {NgClassImpl, NgClassImplProvider} from './ng_class_impl';
|
||||
|
||||
@ -35,11 +35,11 @@ export const ngClassDirectiveDef__POST_R3__ = ɵdefineDirective({
|
||||
factory: () => {},
|
||||
hostBindings: function(rf: ɵRenderFlags, ctx: any, elIndex: number) {
|
||||
if (rf & ɵRenderFlags.Create) {
|
||||
ɵelementStyling(null, null, null, ctx);
|
||||
ɵelementHostStyling();
|
||||
}
|
||||
if (rf & ɵRenderFlags.Update) {
|
||||
ɵelementStylingMap(elIndex, ctx.getValue(), null, ctx);
|
||||
ɵelementStylingApply(elIndex, ctx);
|
||||
ɵelementHostStylingMap(ctx.getValue());
|
||||
ɵelementHostStylingApply();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -5,7 +5,7 @@
|
||||
* 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 {Directive, DoCheck, Input, ɵRenderFlags, ɵdefineDirective, ɵelementStyling, ɵelementStylingApply, ɵelementStylingMap} from '@angular/core';
|
||||
import {Directive, DoCheck, Input, ɵRenderFlags, ɵdefineDirective, ɵelementHostStyling, ɵelementHostStylingApply, ɵelementHostStylingMap} from '@angular/core';
|
||||
|
||||
import {NgStyleImpl, NgStyleImplProvider} from './ng_style_impl';
|
||||
|
||||
@ -35,11 +35,11 @@ export const ngStyleDirectiveDef__POST_R3__ = ɵdefineDirective({
|
||||
factory: () => {},
|
||||
hostBindings: function(rf: ɵRenderFlags, ctx: any, elIndex: number) {
|
||||
if (rf & ɵRenderFlags.Create) {
|
||||
ɵelementStyling(null, null, null, ctx);
|
||||
ɵelementHostStyling();
|
||||
}
|
||||
if (rf & ɵRenderFlags.Update) {
|
||||
ɵelementStylingMap(elIndex, null, ctx.getValue(), ctx);
|
||||
ɵelementStylingApply(elIndex, ctx);
|
||||
ɵelementHostStylingMap(null, ctx.getValue());
|
||||
ɵelementHostStylingApply();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user