-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix] style manager transition regression (#7831)
- Loading branch information
1 parent
ed078e3
commit 07d6d17
Showing
9 changed files
with
97 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
test/runtime-puppeteer/samples/style_manager-cleanup/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export default { | ||
skip_if_ssr: true, | ||
skip_if_hydrate: true, | ||
skip_if_hydrate_from_ssr: true, | ||
test: async ({ component, assert, window, waitUntil }) => { | ||
assert.htmlEqual(window.document.head.innerHTML, ''); | ||
component.visible = true; | ||
assert.htmlEqual(window.document.head.innerHTML, '<style></style>'); | ||
await waitUntil(() => window.document.head.innerHTML === ''); | ||
assert.htmlEqual(window.document.head.innerHTML, ''); | ||
|
||
component.visible = false; | ||
assert.htmlEqual(window.document.head.innerHTML, '<style></style>'); | ||
await waitUntil(() => window.document.head.innerHTML === ''); | ||
assert.htmlEqual(window.document.head.innerHTML, ''); | ||
} | ||
}; |
16 changes: 16 additions & 0 deletions
16
test/runtime-puppeteer/samples/style_manager-cleanup/main.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<script> | ||
export let visible; | ||
function foo() { | ||
return { | ||
duration: 10, | ||
css: t => { | ||
return `opacity: ${t}`; | ||
} | ||
}; | ||
} | ||
</script> | ||
|
||
{#if visible} | ||
<div transition:foo></div> | ||
{/if} |
14 changes: 14 additions & 0 deletions
14
test/runtime-puppeteer/samples/transition-css-out-in/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export default { | ||
test: async ({ assert, component, window, waitUntil }) => { | ||
component.visible = true; | ||
await waitUntil(() => window.document.head.querySelector('style').sheet.rules.length === 2); | ||
assert.equal(window.document.head.querySelector('style').sheet.rules.length, 2); | ||
await waitUntil(() => window.document.head.querySelector('style') === null); | ||
assert.equal(window.document.head.querySelector('style'), null); | ||
component.visible = false; | ||
await waitUntil(() => window.document.head.querySelector('style').sheet.rules.length === 2); | ||
assert.equal(window.document.head.querySelector('style').sheet.rules.length, 2); | ||
await waitUntil(() => window.document.head.querySelector('style') === null); | ||
assert.equal(window.document.head.querySelector('style'), null); | ||
} | ||
}; |
20 changes: 20 additions & 0 deletions
20
test/runtime-puppeteer/samples/transition-css-out-in/main.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<script> | ||
export let visible; | ||
function foo() { | ||
return { | ||
duration: 10, | ||
css: t => { | ||
return `opacity: ${t}`; | ||
} | ||
}; | ||
} | ||
</script> | ||
|
||
{#if visible} | ||
<div transition:foo></div> | ||
{/if} | ||
|
||
{#if !visible} | ||
<div transition:foo></div> | ||
{/if} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.