-
Notifications
You must be signed in to change notification settings - Fork 680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-transforms-1] [css-transitions-1] Strange behavior with insertBefore
vs appendChild
and transitions
#5334
Comments
See #3309. When you use |
Thanks, that's probably it. Does CSS transitions detail this somehow? |
Yeah, that's it, and it is specified:
And also:
|
The first should maybe be reworded to "when an element is removed from the document" since the element might be in the document again when CSS next gets to look at it. |
In case it was missed, the code snippets are literally just following the FLIP pattern minus the last step of removing the transition class after the transition completes. Here's some pseudocode for what each element is doing:
The glitches seem to involve the starting point for the |
Update: Found a simpler reproduction. Movement primitives would not help fix this one, as the former does not add nodes with existing parents. Edit: simplify it further. |
And here's it simplified and deconstructed using two elements, one static and alternating remove/add, the other animated:
The only ones smooth are removing all nodes and re-adding the ones desired - no implicit removal is necessary. And it only affects nodes that are not removed. I've confirmed this in both Chrome and Firefox on Windows. |
/cc @annevk in case you missed it |
@isiahmeadows what would be interesting to know for this issue is if any of the cases you tested contradicts with the specification somehow. |
That I'm not sure of, but I'm not nearly familiar enough with the relevant CSS specs to fully discern it. Edit: My suspicion is that it's probably consistent with the spec, but my confidence level is like maybe at most 20%. |
Originally filed in whatwg/html#5742, but it was recommended I post it here.
Relevant specs, though I'm not for certain which sections apply:
When using
insertBefore
with transitions and the FLIP technique, I get very strange results across browsers.appendChild
insertBefore
The only difference is the way the DOM nodes are rearranged, which is what confuses me about this.
Code for each
insertBefore
:appendChild
:I've reproduced this behavior explained above on each of the following platforms:
Relevant framework bugs I've filed, before I narrowed it down further to this:
I suspect it's a bug in all three of those listed browsers, but I'm filing an issue here in case it's actually a spec issue or if a spec note is necessary for this.
The text was updated successfully, but these errors were encountered: