Skip to content

Commit 9c106f4

Browse files
crisbetothePunderWoman
authored andcommitted
refactor(core): introduce domProperty instruction (angular#60608)
Renames the `hostProperty` instruction to `domProperty` since it's not really host-specific and we can use it for other DOM-specific operations in the future. PR Close angular#60608
1 parent 8562667 commit 9c106f4

34 files changed

+60
-62
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
hostBindings: function MyDirective_HostBindings(rf, ctx) {
22
33
if (rf & 2) {
4-
$r3$.ɵɵhostProperty("tabindex", 1);
4+
$r3$.ɵɵdomProperty("tabindex", 1);
55
$r3$.ɵɵattribute("title", "my title")("id", "my-id");
66
}
77
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
hostBindings: function MyDirective_HostBindings(rf, ctx) {
22
33
if (rf & 2) {
4-
$r3$.ɵɵhostProperty("title", ctx.myTitle)("tabindex", 1)("id", ctx.myId);
4+
$r3$.ɵɵdomProperty("title", ctx.myTitle)("tabindex", 1)("id", ctx.myId);
55
}
66
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
hostBindings: function MyDirective_HostBindings(rf, ctx) {
22
33
if (rf & 2) {
4-
$r3$.ɵɵhostProperty("tabindex", 1)("title", ctx.myTitle)("id", ctx.myId);
4+
$r3$.ɵɵdomProperty("tabindex", 1)("title", ctx.myTitle)("id", ctx.myId);
55
}
66
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
hostBindings: function MyDirective_HostBindings(rf, ctx) {
22
33
if (rf & 2) {
4-
$r3$.ɵɵhostProperty("title", "my title")("id", "my-id");
4+
$r3$.ɵɵdomProperty("title", "my title")("id", "my-id");
55
$r3$.ɵɵattribute("tabindex", 1);
66
}
77
}

packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_bindings/host_bindings/host_bindings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ HostBindingDir.ɵdir = /*@__PURE__*/ $r3$.ɵɵdefineDirective({
55
hostVars: 1,
66
hostBindings: function HostBindingDir_HostBindings(rf, ctx) {
77
if (rf & 2) {
8-
$r3$.ɵɵhostProperty("id", ctx.dirId);
8+
$r3$.ɵɵdomProperty("id", ctx.dirId);
99
}
1010
},
1111
standalone: false

packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_bindings/host_bindings/host_bindings_with_pure_functions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ HostBindingComp.ɵcmp = /*@__PURE__*/ $r3$.ɵɵdefineComponent({
77
hostVars: 3,
88
hostBindings: function HostBindingComp_HostBindings(rf, ctx) {
99
if (rf & 2) {
10-
$r3$.ɵɵhostProperty("id", $r3$.ɵɵpureFunction1(1, $ff$, ctx.id));
10+
$r3$.ɵɵdomProperty("id", $r3$.ɵɵpureFunction1(1, $ff$, ctx.id));
1111
}
1212
},
1313
standalone: false,

packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_bindings/host_bindings/host_bindings_with_temporaries.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ HostBindingDir.ɵdir = /*@__PURE__*/ $r3$.ɵɵdefineDirective({
66
hostBindings: function HostBindingDir_HostBindings(rf, ctx) {
77
if (rf & 2) {
88
let $tmp0$;
9-
$r3$.ɵɵhostProperty("id", ($tmp0$ = ctx.getData()) == null ? null : $tmp0$.id);
9+
$r3$.ɵɵdomProperty("id", ($tmp0$ = ctx.getData()) == null ? null : $tmp0$.id);
1010
}
1111
},
1212
standalone: false
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
hostBindings: function HostBindingDir_HostBindings(rf, ctx) {
22
if (rf & 2) {
3-
i0.ɵɵhostProperty("innerHtml", ctx.evil, i0.ɵɵsanitizeHtml)("href", ctx.evil, i0.ɵɵsanitizeUrlOrResourceUrl)("src", ctx.evil, i0.ɵɵsanitizeUrlOrResourceUrl)("sandbox", ctx.evil, i0.ɵɵvalidateIframeAttribute);
4-
i0.ɵɵattribute("style", ctx.evil, i0.ɵɵsanitizeStyle);
3+
$r3$.ɵɵdomProperty("innerHtml", ctx.evil, $r3$.ɵɵsanitizeHtml)("href", ctx.evil, $r3$.ɵɵsanitizeUrlOrResourceUrl)("src", ctx.evil, $r3$.ɵɵsanitizeUrlOrResourceUrl)("sandbox", ctx.evil, $r3$.ɵɵvalidateIframeAttribute);
4+
$r3$.ɵɵattribute("style", ctx.evil, $r3$.ɵɵsanitizeStyle);
55
}
66
}
77
88
hostBindings: function HostBindingDir2_HostBindings(rf, ctx) {
99
if (rf & 2) {
10-
i0.ɵɵhostProperty("innerHtml", ctx.evil, i0.ɵɵsanitizeHtml)("href", ctx.evil, i0.ɵɵsanitizeUrl)("src", ctx.evil)("sandbox", ctx.evil, i0.ɵɵvalidateIframeAttribute);
11-
i0.ɵɵattribute("style", ctx.evil, i0.ɵɵsanitizeStyle);
10+
$r3$.ɵɵdomProperty("innerHtml", ctx.evil, $r3$.ɵɵsanitizeHtml)("href", ctx.evil, $r3$.ɵɵsanitizeUrl)("src", ctx.evil)("sandbox", ctx.evil, $r3$.ɵɵvalidateIframeAttribute);
11+
$r3$.ɵɵattribute("style", ctx.evil, $r3$.ɵɵsanitizeStyle);
1212
}
1313
}

packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_bindings/order_bindings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function MyCmp_HostBindings(rf, ctx) {
55
i0.ɵɵlistener("event1", function MyCmp_event1_HostBindingHandler() { return ctx.foo(); });
66
}
77
if (rf & 2) {
8-
i0.ɵɵhostProperty("prop1", ctx.foo);
8+
i0.ɵɵdomProperty("prop1", ctx.foo);
99
i0.ɵɵattribute("attr1", ctx.foo);
1010
i0.ɵɵstyleMap(ctx.foo);
1111
i0.ɵɵclassMap(ctx.foo);

packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_styling/binding_slots/component_host_binding_slots.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ hostAttrs: ["title", "foo title", __AttributeMarker.Classes__, "foo", "baz", __A
22
hostVars: 6,
33
hostBindings: function MyComponent_HostBindings(rf, ctx) {
44
if (rf & 2) {
5-
$r3$.ɵɵhostProperty("id", ctx.id)("title", ctx.title);
5+
$r3$.ɵɵdomProperty("id", ctx.id)("title", ctx.title);
66
$r3$.ɵɵstyleMap(ctx.myStyle);
77
$r3$.ɵɵclassMap(ctx.myClass);
88
}

0 commit comments

Comments
 (0)