mirror of https://github.com/sveltejs/svelte
fix: simplify and robustify appending styles (#13303)
#13225 did not fully fix the described issue: As soon as you have a child component, that child component's anchor will not be in the right ownerDocument yet, and so the logic falls down. To fix that, we would need to move the ownerDocument check into the microtask - and that map check was mainly done to avoid just that. So instead I opted to simplify the code and just remove the map checks. According to my benchmarking (https://jsbench.me/3hm17l0bxl/1) this has no impact on performance assuming that you'll have cache hits roughly half the time - and even if you'd have much more cache hits, the performance loss is microscopic. Given that the default mode is to not inject styles, this will not be common anyway, so I favor removing that map.pull/13311/head
parent
f852a6890b
commit
d338e8083f
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: simplify and robustify appending styles
|
@ -0,0 +1,9 @@
|
||||
<svelte:options css="injected" />
|
||||
|
||||
<h1>inner</h1>
|
||||
|
||||
<style>
|
||||
h1 {
|
||||
color: blue;
|
||||
}
|
||||
</style>
|
Loading…
Reference in new issue