-
Notifications
You must be signed in to change notification settings - Fork 428
Permanent nodes with iframes are reloaded #511
Comments
Here's an example for the behaviour described: https://github.com/ruigomeseu/turbolinks-permanent-bug |
This is a limitation of iframes — both WebKit and Firefox agree that they should be reloaded when they're moved in the DOM tree: It's even part of the spec now: So unfortunately we can't fix this in Turbolinks. |
Why move the node at all, though? This is an obvious case where the part of the DOM being updated is not in the direct hierarchy of the permanent node and should leave the permanent node entirely untouched. The only node that should be affected is the div containing rest of the site. The fact that Turbolinks does touch the permanent node is completely unintuitive. |
Because we're replacing a parent of the permanent node (the
That div is the |
Can't there be a way to specify don't replace the body itself, only children that are not marked permanent? It seems like such a common use case. |
That would be quite complex (what if a permanent node is nested in a div that has other children, page cache would need to be re-implemented, etc.). |
No-one said it would be easy. ;) However, I'm talking more about a specific exception for how the body node is processed optionally. I'm not fond of the inconsistency of it, but the idea that there can be a node hanging immediately off of body that can remain untouched would at least provide a solution for everyone having an issue with this. If the permanent node is deeper down the hierarchy then it would be subject to current behavior. |
I have a very simple test node with a Youtube player that should be playing throughout all pages of my website:
When I change pages the iframe gets reloaded, wish shouldn't happen after the #479 fix.
The text was updated successfully, but these errors were encountered: