Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f550f4a

Browse files
cexbrayatthePunderWoman
authored andcommitted
docs: ExperimentalIsolatedShadowDom mentions
(cherry picked from commit c137f1f)
1 parent 1a8dbd7 commit f550f4a

File tree

6 files changed

+15
-9
lines changed

6 files changed

+15
-9
lines changed

‎adev/shared-docs/pipeline/api-gen/rendering/test/fake-cli-entries.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
"Emulated",
179179
"None",
180180
"ShadowDom",
181-
"IsolatedShadowDom"
181+
"ExperimentalIsolatedShadowDom"
182182
],
183183
"description": "The view encapsulation strategy to use in the new application."
184184
}
@@ -369,7 +369,7 @@
369369
"Emulated",
370370
"None",
371371
"ShadowDom",
372-
"IsolatedShadowDom"
372+
"ExperimentalIsolatedShadowDom"
373373
],
374374
"description": "The view encapsulation strategy to use in the new component."
375375
}

‎adev/src/content/guide/animations/complex-sequences.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ IMPORTANT: If you need to animate the items of an `*ngFor` list and there is a p
121121

122122
## Animations and Component View Encapsulation
123123

124-
Angular animations are based on the components DOM structure and do not directly take [View Encapsulation](guide/components/styling#style-scoping) into account, this means that components using `ViewEncapsulation.Emulated` behave exactly as if they were using `ViewEncapsulation.None` (`ViewEncapsulation.ShadowDom` and `ViewEncapsulation.IsolatedShadowDom` behave differently as we'll discuss shortly).
124+
Angular animations are based on the components DOM structure and do not directly take [View Encapsulation](guide/components/styling#style-scoping) into account, this means that components using `ViewEncapsulation.Emulated` behave exactly as if they were using `ViewEncapsulation.None` (`ViewEncapsulation.ShadowDom` and `ViewEncapsulation.ExperimentalIsolatedShadowDom` behave differently as we'll discuss shortly).
125125

126126
For example if the `query()` function (which you'll see more of in the rest of the Animations guide) were to be applied at the top of a tree of components using the emulated view encapsulation, such query would be able to identify (and thus animate) DOM elements on any depth of the tree.
127127

128-
On the other hand the `ViewEncapsulation.ShadowDom` and `ViewEncapsulation.IsolatedShadowDom` changes the component's DOM structure by "hiding" DOM elements inside [`ShadowRoot`](https://developer.mozilla.org/docs/Web/API/ShadowRoot) elements. Such DOM manipulations do prevent some of the animations implementation to work properly since it relies on simple DOM structures and doesn't take `ShadowRoot` elements into account. Therefore it is advised to avoid applying animations to views incorporating components using the ShadowDom view encapsulation.
128+
On the other hand the `ViewEncapsulation.ShadowDom` and `ViewEncapsulation.ExperimentalIsolatedShadowDom` changes the component's DOM structure by "hiding" DOM elements inside [`ShadowRoot`](https://developer.mozilla.org/docs/Web/API/ShadowRoot) elements. Such DOM manipulations do prevent some of the animations implementation to work properly since it relies on simple DOM structures and doesn't take `ShadowRoot` elements into account. Therefore it is advised to avoid applying animations to views incorporating components using the ShadowDom view encapsulation.
129129

130130
## Animation sequence summary
131131

‎adev/src/content/guide/components/styling.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ and [stylus](https://stylus-lang.com).
3636
## Style scoping
3737

3838
Every component has a **view encapsulation** setting that determines how the framework scopes a
39-
component's styles. There are four view encapsulation modes: `Emulated`, `ShadowDom`, `IsolatedShadowDom`, and `None`.
39+
component's styles. There are four view encapsulation modes: `Emulated`, `ShadowDom`, `ExperimentalIsolatedShadowDom`, and `None`.
4040
You can specify the mode in the `@Component` decorator:
4141

4242
<docs-code language="angular-ts" highlight="[3]">
@@ -91,7 +91,7 @@ with [the `<slot>` API](https://developer.mozilla.org/docs/Web/Web_Components/Us
9191
and how browser developer tools show elements. Always understand the full implications of using
9292
Shadow DOM in your application before enabling this option.
9393

94-
### ViewEncapsulation.IsolatedShadowDom
94+
### ViewEncapsulation.ExperimentalIsolatedShadowDom
9595

9696
Behaves as above, except this mode strictly guarantees that _only_ that component's styles apply to elements in the
9797
component's template. Global styles cannot affect elements in a shadow tree and styles inside the

‎devtools/projects/ng-devtools/src/lib/devtools-tabs/directive-explorer/property-tab/property-tab-header/component-metadata/component-metadata.component.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,13 @@ export class ComponentMetadataComponent {
3636

3737
private _nestedProps = inject(ElementPropertyResolver);
3838

39-
angularViewEncapsulationModes = ['Emulated', 'Native', 'None', 'ShadowDom', 'IsolatedShadowDom'];
39+
angularViewEncapsulationModes = [
40+
'Emulated',
41+
'Native',
42+
'None',
43+
'ShadowDom',
44+
'ExperimentalIsolatedShadowDom',
45+
];
4046
acxViewEncapsulationModes = ['Emulated', 'None'];
4147

4248
readonly controller = computed(() => {

‎packages/platform-browser/src/dom/dom_renderer.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ class ShadowDomRenderer extends DefaultDomRenderer2 {
522522
this.shadowRoot = (hostEl as any).attachShadow({mode: 'open'});
523523

524524
// SharedStylesHost is used to add styles to the shadow root by ShadowDom.
525-
// This is optional as it is not used by IsolatedShadowDom.
525+
// This is optional as it is not used by ExperimentalIsolatedShadowDom.
526526
if (this.sharedStylesHost) {
527527
this.sharedStylesHost.addHost(this.shadowRoot);
528528
}

‎packages/platform-browser/test/dom/dom_renderer_spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ describe('DefaultDomRendererV2', () => {
159159
expect(window.getComputedStyle(none).backgroundColor).toEqual('rgba(0, 0, 0, 0)');
160160
});
161161

162-
it('shadow components should not be polluted by child components styles when using IsolatedShadowDom', () => {
162+
it('shadow components should not be polluted by child components styles when using ExperimentalIsolatedShadowDom', () => {
163163
const fixture = TestBed.createComponent(IsolatedShadowComponentParentApp);
164164
fixture.detectChanges();
165165

0 commit comments

Comments
 (0)