From b99008bbd6b799becc686ec719c5bbc3fd3257bb Mon Sep 17 00:00:00 2001 From: James Tu Date: Mon, 29 Jan 2024 00:13:19 -0800 Subject: [PATCH] refactor: remove `shadowSupportMode = 'any'` (#3953) --- .../@lwc/engine-core/src/framework/def.ts | 1 - packages/@lwc/engine-core/src/framework/vm.ts | 32 ++++++------------- packages/@lwc/features/src/index.ts | 1 - packages/@lwc/features/src/types.ts | 6 ---- .../light-dom/scoped-styles/index.spec.js | 10 +----- .../index.spec.js | 25 +-------------- .../x/valid/valid.js | 2 +- .../restrictions/x/component/component.js | 2 -- .../scoped-ids/scoped-ids.spec.js | 10 +----- .../scoped-ids/x/test/test.js | 2 +- .../slotting/x/child/child.js | 2 +- .../synthetic-behavior/index.spec.js | 9 +----- .../grandparentAnyParentAnyChildAny.js | 2 +- .../grandparentAnyParentAnyChildReset.js | 2 +- .../grandparentAnyParentResetChildAny.js | 2 +- .../grandparentAnyParentResetChildReset.js | 2 +- .../synthetic-behavior/x/leafAny/leafAny.js | 2 +- .../x/parentAnyChildAny/parentAnyChildAny.js | 2 +- .../parentAnyChildReset.js | 2 +- .../transitivity/index.spec.js | 9 ++---- .../transitivity/x/native/native.js | 2 +- .../x/nativeContainer/nativeContainer.js | 2 +- .../test/static-content/index.spec.js | 9 +----- .../test/static-content/x/native/native.js | 2 +- 24 files changed, 30 insertions(+), 110 deletions(-) diff --git a/packages/@lwc/engine-core/src/framework/def.ts b/packages/@lwc/engine-core/src/framework/def.ts index 707046745b..0c613eb381 100644 --- a/packages/@lwc/engine-core/src/framework/def.ts +++ b/packages/@lwc/engine-core/src/framework/def.ts @@ -122,7 +122,6 @@ function createComponentDef(Ctor: LightningElementConstructor): ComponentDef { if ( !isUndefined(ctorShadowSupportMode) && - ctorShadowSupportMode !== ShadowSupportMode.Any && ctorShadowSupportMode !== ShadowSupportMode.Default && ctorShadowSupportMode !== ShadowSupportMode.Native ) { diff --git a/packages/@lwc/engine-core/src/framework/vm.ts b/packages/@lwc/engine-core/src/framework/vm.ts index da070de8fb..89f3b893ab 100644 --- a/packages/@lwc/engine-core/src/framework/vm.ts +++ b/packages/@lwc/engine-core/src/framework/vm.ts @@ -94,7 +94,6 @@ export const enum ShadowMode { } export const enum ShadowSupportMode { - Any = 'any', Default = 'reset', Native = 'native', } @@ -509,35 +508,24 @@ function computeShadowMode(def: ComponentDef, owner: VM | null, renderer: Render const { isSyntheticShadowDefined } = renderer; let shadowMode; - // If ENABLE_FORCE_SHADOW_MIGRATE_MODE is true, then ShadowMode.Synthetic here will mean "force-migrate" mode. if (isSyntheticShadowDefined || lwcRuntimeFlags.ENABLE_FORCE_SHADOW_MIGRATE_MODE) { if (def.renderMode === RenderMode.Light) { // ShadowMode.Native implies "not synthetic shadow" which is consistent with how // everything defaults to native when the synthetic shadow polyfill is unavailable. shadowMode = ShadowMode.Native; - } else if ( - lwcRuntimeFlags.ENABLE_MIXED_SHADOW_MODE || - def.shadowSupportMode === ShadowSupportMode.Native - ) { - if ( - def.shadowSupportMode === ShadowSupportMode.Any || - def.shadowSupportMode === ShadowSupportMode.Native - ) { + } else if (def.shadowSupportMode === ShadowSupportMode.Native) { + shadowMode = ShadowMode.Native; + } else { + const shadowAncestor = getNearestShadowAncestor(owner); + if (!isNull(shadowAncestor) && shadowAncestor.shadowMode === ShadowMode.Native) { + // Transitive support for native Shadow DOM. A component in native mode + // transitively opts all of its descendants into native. shadowMode = ShadowMode.Native; } else { - const shadowAncestor = getNearestShadowAncestor(owner); - if (!isNull(shadowAncestor) && shadowAncestor.shadowMode === ShadowMode.Native) { - // Transitive support for native Shadow DOM. A component in native mode - // transitively opts all of its descendants into native. - shadowMode = ShadowMode.Native; - } else { - // Synthetic if neither this component nor any of its ancestors are configured - // to be native. - shadowMode = ShadowMode.Synthetic; - } + // Synthetic if neither this component nor any of its ancestors are configured + // to be native. + shadowMode = ShadowMode.Synthetic; } - } else { - shadowMode = ShadowMode.Synthetic; } } else { // Native if the synthetic shadow polyfill is unavailable. diff --git a/packages/@lwc/features/src/index.ts b/packages/@lwc/features/src/index.ts index f62305270b..ef2664023a 100644 --- a/packages/@lwc/features/src/index.ts +++ b/packages/@lwc/features/src/index.ts @@ -12,7 +12,6 @@ import { FeatureFlagMap, FeatureFlagName, FeatureFlagValue } from './types'; const features: FeatureFlagMap = { PLACEHOLDER_TEST_FLAG: null, ENABLE_FORCE_NATIVE_SHADOW_MODE_FOR_TEST: null, - ENABLE_MIXED_SHADOW_MODE: null, DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE: null, ENABLE_WIRE_SYNC_EMIT: null, DISABLE_LIGHT_DOM_UNSCOPED_CSS: null, diff --git a/packages/@lwc/features/src/types.ts b/packages/@lwc/features/src/types.ts index 6142060b91..8f6a9ac74a 100644 --- a/packages/@lwc/features/src/types.ts +++ b/packages/@lwc/features/src/types.ts @@ -21,12 +21,6 @@ export interface FeatureFlagMap { */ PLACEHOLDER_TEST_FLAG: FeatureFlagValue; - /** - * LWC engine flag to enable mixed shadow mode. Setting this flag to `true` enables usage of - * native shadow DOM even when the synthetic shadow polyfill is applied. - */ - ENABLE_MIXED_SHADOW_MODE: FeatureFlagValue; - /** * LWC engine flag to force native shadow mode for mixed shadow mode testing. */ diff --git a/packages/@lwc/integration-karma/test/light-dom/scoped-styles/index.spec.js b/packages/@lwc/integration-karma/test/light-dom/scoped-styles/index.spec.js index e1ff218aed..a54cf52732 100644 --- a/packages/@lwc/integration-karma/test/light-dom/scoped-styles/index.spec.js +++ b/packages/@lwc/integration-karma/test/light-dom/scoped-styles/index.spec.js @@ -1,4 +1,4 @@ -import { createElement, setFeatureFlagForTest } from 'lwc'; +import { createElement } from 'lwc'; import { extractDataIds } from 'test-utils'; import Basic from 'x/basic'; import Other from 'x/other'; @@ -8,14 +8,6 @@ import ShadowWithScoped from 'x/shadowWithScoped'; import PseudoParent from 'x/pseudoParent'; describe('Light DOM scoped CSS', () => { - beforeAll(() => { - setFeatureFlagForTest('ENABLE_MIXED_SHADOW_MODE', true); - }); - - afterAll(() => { - setFeatureFlagForTest('ENABLE_MIXED_SHADOW_MODE', false); - }); - it('should scope scoped CSS and allow unscoped CSS to leak out', () => { const basicElement = createElement('x-basic', { is: Basic }); const otherElement = createElement('x-other', { is: Other }); diff --git a/packages/@lwc/integration-karma/test/mixed-shadow-mode/LightningElement.shadowSupportMode/index.spec.js b/packages/@lwc/integration-karma/test/mixed-shadow-mode/LightningElement.shadowSupportMode/index.spec.js index e177c63375..50ee73dc1d 100644 --- a/packages/@lwc/integration-karma/test/mixed-shadow-mode/LightningElement.shadowSupportMode/index.spec.js +++ b/packages/@lwc/integration-karma/test/mixed-shadow-mode/LightningElement.shadowSupportMode/index.spec.js @@ -1,4 +1,4 @@ -import { createElement, setFeatureFlagForTest } from 'lwc'; +import { createElement } from 'lwc'; import { isNativeShadowRootInstance, isSyntheticShadowRootInstance } from 'test-utils'; import Invalid from 'x/invalid'; @@ -19,29 +19,6 @@ describe('shadowSupportMode static property', () => { }); }); -describe('ENABLE_MIXED_SHADOW_MODE', () => { - beforeEach(() => { - setFeatureFlagForTest('ENABLE_MIXED_SHADOW_MODE', true); - }); - - it('should be configured as "any" (sanity)', () => { - expect(Valid.shadowSupportMode === 'any').toBeTrue(); - }); - - it('should enable mixed shadow mode', () => { - const elm = createElement('x-valid', { is: Valid }); - if (process.env.NATIVE_SHADOW_ROOT_DEFINED) { - expect(isNativeShadowRootInstance(elm.shadowRoot)).toBeTrue(); - } else { - expect(isSyntheticShadowRootInstance(elm.shadowRoot)).toBeTrue(); - } - }); - - afterEach(() => { - setFeatureFlagForTest('ENABLE_MIXED_SHADOW_MODE', false); - }); -}); - describe('ENABLE_NATIVE_SHADOW_MODE', () => { it('should be configured as "native" (sanity)', () => { expect(NativeOnly.shadowSupportMode === 'native').toBeTrue(); diff --git a/packages/@lwc/integration-karma/test/mixed-shadow-mode/LightningElement.shadowSupportMode/x/valid/valid.js b/packages/@lwc/integration-karma/test/mixed-shadow-mode/LightningElement.shadowSupportMode/x/valid/valid.js index 692886f15e..5101407e38 100644 --- a/packages/@lwc/integration-karma/test/mixed-shadow-mode/LightningElement.shadowSupportMode/x/valid/valid.js +++ b/packages/@lwc/integration-karma/test/mixed-shadow-mode/LightningElement.shadowSupportMode/x/valid/valid.js @@ -1,5 +1,5 @@ import { LightningElement } from 'lwc'; export default class extends LightningElement { - static shadowSupportMode = 'any'; + static shadowSupportMode = 'native'; } diff --git a/packages/@lwc/integration-karma/test/mixed-shadow-mode/restrictions/x/component/component.js b/packages/@lwc/integration-karma/test/mixed-shadow-mode/restrictions/x/component/component.js index a697ad0347..e6a1a57518 100644 --- a/packages/@lwc/integration-karma/test/mixed-shadow-mode/restrictions/x/component/component.js +++ b/packages/@lwc/integration-karma/test/mixed-shadow-mode/restrictions/x/component/component.js @@ -1,8 +1,6 @@ import { LightningElement, api } from 'lwc'; export default class extends LightningElement { - static shadowSupportMode = 'any'; - @api setInnerHtmlOnShadowRoot() { this.template.innerHTML = '
'; diff --git a/packages/@lwc/integration-karma/test/mixed-shadow-mode/scoped-ids/scoped-ids.spec.js b/packages/@lwc/integration-karma/test/mixed-shadow-mode/scoped-ids/scoped-ids.spec.js index a839ca25d8..b6b3ebaca4 100644 --- a/packages/@lwc/integration-karma/test/mixed-shadow-mode/scoped-ids/scoped-ids.spec.js +++ b/packages/@lwc/integration-karma/test/mixed-shadow-mode/scoped-ids/scoped-ids.spec.js @@ -1,15 +1,7 @@ -import { createElement, setFeatureFlagForTest } from 'lwc'; +import { createElement } from 'lwc'; import Test from 'x/test'; describe('scoped-ids', () => { - beforeAll(() => { - setFeatureFlagForTest('ENABLE_MIXED_SHADOW_MODE', true); - }); - - afterAll(() => { - setFeatureFlagForTest('ENABLE_MIXED_SHADOW_MODE', false); - }); - it('should entrust id scoping to native shadow (static)', () => { const elm = createElement('x-test', { is: Test }); document.body.appendChild(elm); diff --git a/packages/@lwc/integration-karma/test/mixed-shadow-mode/scoped-ids/x/test/test.js b/packages/@lwc/integration-karma/test/mixed-shadow-mode/scoped-ids/x/test/test.js index b13b53e6b0..d8ed8babc1 100644 --- a/packages/@lwc/integration-karma/test/mixed-shadow-mode/scoped-ids/x/test/test.js +++ b/packages/@lwc/integration-karma/test/mixed-shadow-mode/scoped-ids/x/test/test.js @@ -1,7 +1,7 @@ import { LightningElement } from 'lwc'; export default class extends LightningElement { - static shadowSupportMode = 'any'; + static shadowSupportMode = 'native'; get yamanashi() { return 'yamanashi'; diff --git a/packages/@lwc/integration-karma/test/mixed-shadow-mode/slotting/x/child/child.js b/packages/@lwc/integration-karma/test/mixed-shadow-mode/slotting/x/child/child.js index 254f749a1e..732d7371f9 100644 --- a/packages/@lwc/integration-karma/test/mixed-shadow-mode/slotting/x/child/child.js +++ b/packages/@lwc/integration-karma/test/mixed-shadow-mode/slotting/x/child/child.js @@ -1,5 +1,5 @@ import { LightningElement } from 'lwc'; export default class Child extends LightningElement { - static shadowSupportMode = 'any'; + static shadowSupportMode = 'native'; } diff --git a/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/index.spec.js b/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/index.spec.js index 6f714bd1d5..54bde810e8 100644 --- a/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/index.spec.js +++ b/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/index.spec.js @@ -1,4 +1,4 @@ -import { createElement, setFeatureFlagForTest } from 'lwc'; +import { createElement } from 'lwc'; import { extractDataIds, isNativeShadowRootInstance } from 'test-utils'; import ParentAnyChildAny from 'x/parentAnyChildAny'; import ParentAnyChildReset from 'x/parentAnyChildReset'; @@ -17,13 +17,6 @@ import GrandparentResetParentResetChildReset from 'x/grandparentResetParentReset if (!process.env.NATIVE_SHADOW) { describe('synthetic behavior', () => { - beforeEach(() => { - setFeatureFlagForTest('ENABLE_MIXED_SHADOW_MODE', true); - }); - afterEach(() => { - setFeatureFlagForTest('ENABLE_MIXED_SHADOW_MODE', false); - }); - const scenarios = [ { Component: ParentAnyChildAny, diff --git a/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/x/grandparentAnyParentAnyChildAny/grandparentAnyParentAnyChildAny.js b/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/x/grandparentAnyParentAnyChildAny/grandparentAnyParentAnyChildAny.js index 692886f15e..5101407e38 100644 --- a/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/x/grandparentAnyParentAnyChildAny/grandparentAnyParentAnyChildAny.js +++ b/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/x/grandparentAnyParentAnyChildAny/grandparentAnyParentAnyChildAny.js @@ -1,5 +1,5 @@ import { LightningElement } from 'lwc'; export default class extends LightningElement { - static shadowSupportMode = 'any'; + static shadowSupportMode = 'native'; } diff --git a/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/x/grandparentAnyParentAnyChildReset/grandparentAnyParentAnyChildReset.js b/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/x/grandparentAnyParentAnyChildReset/grandparentAnyParentAnyChildReset.js index 692886f15e..5101407e38 100644 --- a/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/x/grandparentAnyParentAnyChildReset/grandparentAnyParentAnyChildReset.js +++ b/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/x/grandparentAnyParentAnyChildReset/grandparentAnyParentAnyChildReset.js @@ -1,5 +1,5 @@ import { LightningElement } from 'lwc'; export default class extends LightningElement { - static shadowSupportMode = 'any'; + static shadowSupportMode = 'native'; } diff --git a/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/x/grandparentAnyParentResetChildAny/grandparentAnyParentResetChildAny.js b/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/x/grandparentAnyParentResetChildAny/grandparentAnyParentResetChildAny.js index 692886f15e..5101407e38 100644 --- a/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/x/grandparentAnyParentResetChildAny/grandparentAnyParentResetChildAny.js +++ b/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/x/grandparentAnyParentResetChildAny/grandparentAnyParentResetChildAny.js @@ -1,5 +1,5 @@ import { LightningElement } from 'lwc'; export default class extends LightningElement { - static shadowSupportMode = 'any'; + static shadowSupportMode = 'native'; } diff --git a/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/x/grandparentAnyParentResetChildReset/grandparentAnyParentResetChildReset.js b/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/x/grandparentAnyParentResetChildReset/grandparentAnyParentResetChildReset.js index 692886f15e..5101407e38 100644 --- a/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/x/grandparentAnyParentResetChildReset/grandparentAnyParentResetChildReset.js +++ b/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/x/grandparentAnyParentResetChildReset/grandparentAnyParentResetChildReset.js @@ -1,5 +1,5 @@ import { LightningElement } from 'lwc'; export default class extends LightningElement { - static shadowSupportMode = 'any'; + static shadowSupportMode = 'native'; } diff --git a/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/x/leafAny/leafAny.js b/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/x/leafAny/leafAny.js index 692886f15e..5101407e38 100644 --- a/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/x/leafAny/leafAny.js +++ b/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/x/leafAny/leafAny.js @@ -1,5 +1,5 @@ import { LightningElement } from 'lwc'; export default class extends LightningElement { - static shadowSupportMode = 'any'; + static shadowSupportMode = 'native'; } diff --git a/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/x/parentAnyChildAny/parentAnyChildAny.js b/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/x/parentAnyChildAny/parentAnyChildAny.js index 692886f15e..5101407e38 100644 --- a/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/x/parentAnyChildAny/parentAnyChildAny.js +++ b/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/x/parentAnyChildAny/parentAnyChildAny.js @@ -1,5 +1,5 @@ import { LightningElement } from 'lwc'; export default class extends LightningElement { - static shadowSupportMode = 'any'; + static shadowSupportMode = 'native'; } diff --git a/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/x/parentAnyChildReset/parentAnyChildReset.js b/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/x/parentAnyChildReset/parentAnyChildReset.js index 692886f15e..5101407e38 100644 --- a/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/x/parentAnyChildReset/parentAnyChildReset.js +++ b/packages/@lwc/integration-karma/test/mixed-shadow-mode/synthetic-behavior/x/parentAnyChildReset/parentAnyChildReset.js @@ -1,5 +1,5 @@ import { LightningElement } from 'lwc'; export default class extends LightningElement { - static shadowSupportMode = 'any'; + static shadowSupportMode = 'native'; } diff --git a/packages/@lwc/integration-karma/test/mixed-shadow-mode/transitivity/index.spec.js b/packages/@lwc/integration-karma/test/mixed-shadow-mode/transitivity/index.spec.js index f461007c9a..a3acc3ab48 100644 --- a/packages/@lwc/integration-karma/test/mixed-shadow-mode/transitivity/index.spec.js +++ b/packages/@lwc/integration-karma/test/mixed-shadow-mode/transitivity/index.spec.js @@ -1,4 +1,4 @@ -import { createElement, setFeatureFlagForTest } from 'lwc'; +import { createElement } from 'lwc'; import { isNativeShadowRootInstance, isSyntheticShadowRootInstance } from 'test-utils'; import ResetExtendsAny from 'x/resetExtendsAny'; @@ -14,19 +14,14 @@ function assertNativeShadowRootWhenPossible(elm) { } if (!process.env.NATIVE_SHADOW) { - describe('when root component shadowSupportMode="any"', () => { + describe('when root component shadowSupportMode="native"', () => { let elm; beforeEach(() => { - setFeatureFlagForTest('ENABLE_MIXED_SHADOW_MODE', true); elm = createElement('x-native-container', { is: NativeContainer }); document.body.appendChild(elm); }); - afterAll(() => { - setFeatureFlagForTest('ENABLE_MIXED_SHADOW_MODE', false); - }); - it('should attach a native shadow root when possible', () => { assertNativeShadowRootWhenPossible(elm); }); diff --git a/packages/@lwc/integration-karma/test/mixed-shadow-mode/transitivity/x/native/native.js b/packages/@lwc/integration-karma/test/mixed-shadow-mode/transitivity/x/native/native.js index 692886f15e..5101407e38 100644 --- a/packages/@lwc/integration-karma/test/mixed-shadow-mode/transitivity/x/native/native.js +++ b/packages/@lwc/integration-karma/test/mixed-shadow-mode/transitivity/x/native/native.js @@ -1,5 +1,5 @@ import { LightningElement } from 'lwc'; export default class extends LightningElement { - static shadowSupportMode = 'any'; + static shadowSupportMode = 'native'; } diff --git a/packages/@lwc/integration-karma/test/mixed-shadow-mode/transitivity/x/nativeContainer/nativeContainer.js b/packages/@lwc/integration-karma/test/mixed-shadow-mode/transitivity/x/nativeContainer/nativeContainer.js index 692886f15e..5101407e38 100644 --- a/packages/@lwc/integration-karma/test/mixed-shadow-mode/transitivity/x/nativeContainer/nativeContainer.js +++ b/packages/@lwc/integration-karma/test/mixed-shadow-mode/transitivity/x/nativeContainer/nativeContainer.js @@ -1,5 +1,5 @@ import { LightningElement } from 'lwc'; export default class extends LightningElement { - static shadowSupportMode = 'any'; + static shadowSupportMode = 'native'; } diff --git a/packages/@lwc/integration-karma/test/static-content/index.spec.js b/packages/@lwc/integration-karma/test/static-content/index.spec.js index 305f07be1b..0f89cae1d1 100644 --- a/packages/@lwc/integration-karma/test/static-content/index.spec.js +++ b/packages/@lwc/integration-karma/test/static-content/index.spec.js @@ -1,4 +1,4 @@ -import { createElement, setFeatureFlagForTest } from 'lwc'; +import { createElement } from 'lwc'; import { extractDataIds } from 'test-utils'; import Container from 'x/container'; import Escape from 'x/escape'; @@ -19,13 +19,6 @@ import PreserveComments from 'x/preserveComments'; if (!process.env.NATIVE_SHADOW) { describe('Mixed mode for static content', () => { - beforeEach(() => { - setFeatureFlagForTest('ENABLE_MIXED_SHADOW_MODE', true); - }); - afterEach(() => { - setFeatureFlagForTest('ENABLE_MIXED_SHADOW_MODE', false); - }); - ['native', 'synthetic'].forEach((firstRenderMode) => { it(`should set the tokens for synthetic shadow when it renders first in ${firstRenderMode}`, () => { const elm = createElement('x-container', { is: Container }); diff --git a/packages/@lwc/integration-karma/test/static-content/x/native/native.js b/packages/@lwc/integration-karma/test/static-content/x/native/native.js index adc0897427..9397b74759 100644 --- a/packages/@lwc/integration-karma/test/static-content/x/native/native.js +++ b/packages/@lwc/integration-karma/test/static-content/x/native/native.js @@ -1,5 +1,5 @@ import { LightningElement } from 'lwc'; export default class Native extends LightningElement { - static shadowSupportMode = 'any'; + static shadowSupportMode = 'native'; }