Skip to content
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-transitions] transition-behavior: allow-discrete; work incorrectly in Safari 17.5 and Firefox Nightly with 100% test passing #46753

Closed
alkorlos opened this issue Jun 14, 2024 · 2 comments

Comments

@alkorlos
Copy link

alkorlos commented Jun 14, 2024

Recently browsers has been active work on implementing the property transition-behavior with the value allow-discrete. Six tests have been written for this property, all of which pass in stable versions of Chrome and Safari, as well as in Firefox Nightly.

This property allows specifies transitions for discrete properties, with the most obvious example being display: none;. Despite achieving 100% test passing, the example (from chrome blog) for display: none; does not work correct in Safari 17.5 and Firefox Nightly. Is it possible that more tests are needed?

@alkorlos alkorlos changed the title [css-transitions] transition-behavior: allow-discrete; work incorrectly in Safari 17.5 and Firefox Nightly with 100% test coverage [css-transitions] transition-behavior: allow-discrete; work incorrectly in Safari 17.5 and Firefox Nightly with 100% test passing Jun 14, 2024
@graouts
Copy link
Contributor

graouts commented Jun 28, 2024

I filed a WebKit bug to look into this. If it is indeed a bug, a fix will include a WPT test.

webkit-commit-queue pushed a commit to graouts/WebKit that referenced this issue Jun 30, 2024
…ome for Developers blog

https://bugs.webkit.org/show_bug.cgi?id=275994

Reviewed by Tim Nguyen.

Historically, setting `display: none` on an element would cancel any running transition. However,
with the addition of `transition-behavior: allow-discrete` and the fact `display` supports discrete
animation, setting `display: none` if that value is being transitioned should not cancel running
transitions.

On top of that, after canceling running transitions, we'd bail out of considering any further transition,
so we would fail to transition the `display` value itself.

We now correctly handle this case by checking in `Styleable::updateCSSTransitions()` whether setting
`display: none` will yield a transition before canceling running transitions and bailing out of that
method.

This was not covered by existing WPT tests, as noted in web-platform-tests/wpt#46753,
so we're adding a new WPT test that checks that we do not cancel running transitions when setting
`display: none` when `display` is getting transitioned.

* LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/CSSTransition-not-canceling.tentative-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/CSSTransition-not-canceling.tentative.html: Added.
* Source/WebCore/style/Styleable.cpp:
(WebCore::Styleable::updateCSSTransitions const):

Canonical link: https://commits.webkit.org/280512@main
@nt1m
Copy link
Member

nt1m commented Jun 30, 2024

Fixed by #46944, this should be fixed in WebKit now too

Fwiw, the example is not working in Firefox, because Firefox doesn't support display interpolation which WPT has separate tests for.

@nt1m nt1m closed this as completed Jun 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants