-
Notifications
You must be signed in to change notification settings - Fork 715
[css-transitions-1] Clarify/confirm behavior when reparenting a transitioning element #3309
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
Comments
The precise nature of the "slow transition" behavior isn't super-specified (tho Web Animations does some nice work in reifying the transition into an explicit Animation object), but I agree with you that Chrome/Firefox/Safari's behavior is the desirable one. Basically, moving an element in the tree should clear all style-related information about it; as far as CSS is concerned, the old element simply evaporated into thin air and a brand new element appeared somewhere else. Thus, just as transitions are canceled when the property they're associated with gets changed again, transitions should simply be dropped when their associated element disappears. This is the same behavior you'd get from flickering it to Whether a move is technically a "remove, then insert" (I think it is for other purposes?), it should be treated the same for transition-canceling purposes. |
I agree with that interpretation but would it help to explicitly call that out somehow? If so, I'm not sure if that should happen by referencing so generic CSS machinery, or by just extending that sentence with some appropriate DOM vocabulary to the effect of, "If an element is no longer in the document or is assigned a different parent node...". Once we have that, we can more easily add a WPT for this. |
Firefox and Chromium finish the transition even if the parent node is the same, and even if the node ends up at the same place (e.g. if you use I guess the relevant step is https://dom.spec.whatwg.org/#concept-node-adopt
So the element is temporarily 'no longer in the document', even if it's inserted back into the document immediately after. |
Given that that wording exists in the DOM spec, I propose I add a css-transition/ WPT test (or tests) to ensure this behavior and we don't adjust the css-transitions-1 spec. I am open to opposing opinions :). |
As per w3c/csswg-drafts#3309, any CSS Transition on a reparented element should be cancelled, as it leaves and then re-enters the Document. This already works on Chrome, Firefox, and Safari but fails on Edge. Bug: 902328 Change-Id: I097675a8146c8047417dd48193d0747216418cfb
As per w3c/csswg-drafts#3309, any CSS Transition on a reparented element should be cancelled, as it leaves and then re-enters the Document. This already works on Chrome, Firefox, and Safari but fails on Edge. Bug: 902328 Change-Id: I097675a8146c8047417dd48193d0747216418cfb
As per w3c/csswg-drafts#3309, any CSS Transition on a reparented element should be cancelled, as it leaves and then re-enters the Document. This already works on Chrome, Firefox, and Safari but fails on Edge. Bug: 902328 Change-Id: I097675a8146c8047417dd48193d0747216418cfb Reviewed-on: https://chromium-review.googlesource.com/c/1374742 Reviewed-by: vmpstr <vmpstr@chromium.org> Commit-Queue: Stephen McGruer <smcgruer@chromium.org> Cr-Commit-Position: refs/heads/master@{#616830}
As per w3c/csswg-drafts#3309, any CSS Transition on a reparented element should be cancelled, as it leaves and then re-enters the Document. This already works on Chrome, Firefox, and Safari but fails on Edge. Bug: 902328 Change-Id: I097675a8146c8047417dd48193d0747216418cfb Reviewed-on: https://chromium-review.googlesource.com/c/1374742 Reviewed-by: vmpstr <vmpstr@chromium.org> Commit-Queue: Stephen McGruer <smcgruer@chromium.org> Cr-Commit-Position: refs/heads/master@{#616830}
As per w3c/csswg-drafts#3309, any CSS Transition on a reparented element should be cancelled, as it leaves and then re-enters the Document. This already works on Chrome, Firefox, and Safari but fails on Edge. Bug: 902328 Change-Id: I097675a8146c8047417dd48193d0747216418cfb Reviewed-on: https://chromium-review.googlesource.com/c/1374742 Reviewed-by: vmpstr <vmpstr@chromium.org> Commit-Queue: Stephen McGruer <smcgruer@chromium.org> Cr-Commit-Position: refs/heads/master@{#616830}
…ng, a=testonly Automatic update from web-platform-tests [CSS Transitions] Add test for reparenting As per w3c/csswg-drafts#3309, any CSS Transition on a reparented element should be cancelled, as it leaves and then re-enters the Document. This already works on Chrome, Firefox, and Safari but fails on Edge. Bug: 902328 Change-Id: I097675a8146c8047417dd48193d0747216418cfb Reviewed-on: https://chromium-review.googlesource.com/c/1374742 Reviewed-by: vmpstr <vmpstr@chromium.org> Commit-Queue: Stephen McGruer <smcgruer@chromium.org> Cr-Commit-Position: refs/heads/master@{#616830} -- wpt-commits: cf8b055289c68215fd4a3274c94d0f5484c27dd3 wpt-pr: 14486
…ng, a=testonly Automatic update from web-platform-tests [CSS Transitions] Add test for reparenting As per w3c/csswg-drafts#3309, any CSS Transition on a reparented element should be cancelled, as it leaves and then re-enters the Document. This already works on Chrome, Firefox, and Safari but fails on Edge. Bug: 902328 Change-Id: I097675a8146c8047417dd48193d0747216418cfb Reviewed-on: https://chromium-review.googlesource.com/c/1374742 Reviewed-by: vmpstr <vmpstr@chromium.org> Commit-Queue: Stephen McGruer <smcgruer@chromium.org> Cr-Commit-Position: refs/heads/master@{#616830} -- wpt-commits: cf8b055289c68215fd4a3274c94d0f5484c27dd3 wpt-pr: 14486
…ng, a=testonly Automatic update from web-platform-tests [CSS Transitions] Add test for reparenting As per w3c/csswg-drafts#3309, any CSS Transition on a reparented element should be cancelled, as it leaves and then re-enters the Document. This already works on Chrome, Firefox, and Safari but fails on Edge. Bug: 902328 Change-Id: I097675a8146c8047417dd48193d0747216418cfb Reviewed-on: https://chromium-review.googlesource.com/c/1374742 Reviewed-by: vmpstr <vmpstrchromium.org> Commit-Queue: Stephen McGruer <smcgruerchromium.org> Cr-Commit-Position: refs/heads/master{#616830} -- wpt-commits: cf8b055289c68215fd4a3274c94d0f5484c27dd3 wpt-pr: 14486 UltraBlame original commit: 86ca0a729bfcfa8a0d8c0e223fd6285b682bb600
…ng, a=testonly Automatic update from web-platform-tests [CSS Transitions] Add test for reparenting As per w3c/csswg-drafts#3309, any CSS Transition on a reparented element should be cancelled, as it leaves and then re-enters the Document. This already works on Chrome, Firefox, and Safari but fails on Edge. Bug: 902328 Change-Id: I097675a8146c8047417dd48193d0747216418cfb Reviewed-on: https://chromium-review.googlesource.com/c/1374742 Reviewed-by: vmpstr <vmpstrchromium.org> Commit-Queue: Stephen McGruer <smcgruerchromium.org> Cr-Commit-Position: refs/heads/master{#616830} -- wpt-commits: cf8b055289c68215fd4a3274c94d0f5484c27dd3 wpt-pr: 14486 UltraBlame original commit: 86ca0a729bfcfa8a0d8c0e223fd6285b682bb600
…ng, a=testonly Automatic update from web-platform-tests [CSS Transitions] Add test for reparenting As per w3c/csswg-drafts#3309, any CSS Transition on a reparented element should be cancelled, as it leaves and then re-enters the Document. This already works on Chrome, Firefox, and Safari but fails on Edge. Bug: 902328 Change-Id: I097675a8146c8047417dd48193d0747216418cfb Reviewed-on: https://chromium-review.googlesource.com/c/1374742 Reviewed-by: vmpstr <vmpstrchromium.org> Commit-Queue: Stephen McGruer <smcgruerchromium.org> Cr-Commit-Position: refs/heads/master{#616830} -- wpt-commits: cf8b055289c68215fd4a3274c94d0f5484c27dd3 wpt-pr: 14486 UltraBlame original commit: 86ca0a729bfcfa8a0d8c0e223fd6285b682bb600
…ng, a=testonly Automatic update from web-platform-tests [CSS Transitions] Add test for reparenting As per w3c/csswg-drafts#3309, any CSS Transition on a reparented element should be cancelled, as it leaves and then re-enters the Document. This already works on Chrome, Firefox, and Safari but fails on Edge. Bug: 902328 Change-Id: I097675a8146c8047417dd48193d0747216418cfb Reviewed-on: https://chromium-review.googlesource.com/c/1374742 Reviewed-by: vmpstr <vmpstr@chromium.org> Commit-Queue: Stephen McGruer <smcgruer@chromium.org> Cr-Commit-Position: refs/heads/master@{#616830} -- wpt-commits: cf8b055289c68215fd4a3274c94d0f5484c27dd3 wpt-pr: 14486
What steps will reproduce the problem?
(1) Navigate to https://output.jsbin.com/celuzow/quiet
(2) Click start transition.
(3) Click reparent element during the transition.
In Chrome, Firefox and Safari, the transition is immediately finished. In Edge, the transition animation is continued after the element is reparented.
From the Chrome side we believe the immediate-finish behavior is correct; I just want to make sure that the spec backs this view, and add a WPT test if one doesn't already exist. One argument may be that it is covered by https://drafts.csswg.org/css-transitions/#starting :
Technically reparenting requires removing the element from its previous parent before setting the new parent. Whether that constitutes being 'no longer in the document' I'm not sure.
The text was updated successfully, but these errors were encountered: