Bug 173708 - Outline-width with transition don't animate correctly
Summary: Outline-width with transition don't animate correctly
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: Safari 10
Hardware: Mac Unspecified
: P2 Normal
Assignee: Antoine Quint
URL: https://codepen.io/juwain/pen/EEazwx
Keywords: InRadar
: 213901 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-06-22 03:20 PDT by zyuzin.vitaly
Modified: 2022-03-02 13:41 PST (History)
19 users (show)

See Also:


Attachments
Test case to reproduce the issue (299 bytes, text/html)
2021-11-25 04:10 PST, Manuel Rego Casasnovas
no flags Details
Patch (1.95 KB, patch)
2022-03-02 00:31 PST, Antoine Quint
no flags Details | Formatted Diff | Diff
Patch (4.33 KB, patch)
2022-03-02 00:45 PST, Antoine Quint
no flags Details | Formatted Diff | Diff
Patch for landing (4.70 KB, patch)
2022-03-02 09:16 PST, Antoine Quint
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description zyuzin.vitaly 2017-06-22 03:20:54 PDT
Please, watch demo https://codepen.io/juwain/pen/jwwZzm.

I have a button with zero-outline.
I want to animate outline-width property of this button on hover.

In Safari it does't animate.
In Chrome, FF it animates correctly.
Comment 1 zyuzin.vitaly 2018-03-10 12:36:26 PST
(In reply to zyuzin.vitaly from comment #0)
> Please, watch demo https://codepen.io/juwain/pen/jwwZzm.
> 
> I have a button with zero-outline.
> I want to animate outline-width property of this button on hover.
> 
> In Safari it does't animate.
> In Chrome, FF it animates correctly.

Test case is here https://codepen.io/juwain/pen/EEazwx
Comment 2 Manuel Rego Casasnovas 2021-11-25 04:10:45 PST
Created attachment 445135 [details]
Test case to reproduce the issue

Just one more test case to reproduce the issue, "outline" combined with "transition" has issues in WebKit.
Comment 3 Manuel Rego Casasnovas 2021-11-25 04:13:15 PST
*** Bug 213901 has been marked as a duplicate of this bug. ***
Comment 4 Manuel Rego Casasnovas 2021-11-25 04:18:49 PST
There's another example of this problem at https://focus-visible-examples.glitch.me/ (from https://bugs.webkit.org/show_bug.cgi?id=225148#c23).

Apart from that there's a related bug report that maybe is caused by this same issue (see #199521).
Comment 5 midnight.mongrel 2022-02-21 15:02:48 PST
Here is another example:
https://codepen.io/m-akinc/pen/OJOZmzB

I have also seen the same issue when trying to apply a transition to a box-shadow that behaves like an outline. I presume it's the same (or very closely related) root cause.

I have reported this on webcompat.com as well: https://webcompat.com/issues/99978
Comment 6 Antoine Quint 2022-03-01 14:02:53 PST
This looks like a painting issue, I can see a bit of the animation running when hovering out but it looks like we're clipping much of the outline.
Comment 7 Simon Fraser (smfr) 2022-03-01 15:25:47 PST
Seems like we're not recomputing visual overflow as the outline width changes.
Comment 8 Antoine Quint 2022-03-02 00:31:39 PST
Created attachment 453577 [details]
Patch
Comment 9 Antoine Quint 2022-03-02 00:45:56 PST
Created attachment 453579 [details]
Patch
Comment 10 Simon Fraser (smfr) 2022-03-02 08:38:12 PST
Comment on attachment 453579 [details]
Patch

Code change looks good but this needs to be a repaint test.
Comment 11 Antoine Quint 2022-03-02 09:16:12 PST
Created attachment 453624 [details]
Patch for landing
Comment 12 EWS 2022-03-02 10:48:31 PST
Committed r290735 (247982@main): <https://commits.webkit.org/247982@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 453624 [details].
Comment 13 Radar WebKit Bug Importer 2022-03-02 10:49:15 PST
<rdar://problem/89698716>
Comment 14 Darin Adler 2022-03-02 11:04:50 PST
Comment on attachment 453624 [details]
Patch for landing

View in context: https://bugs.webkit.org/attachment.cgi?id=453624&action=review

> Source/WebCore/ChangeLog:12
> +        No new test for this, I'm not sure how to write one since the issue is failing to
> +        repaint during an animation but WKTR seems to force a repaint for reftests.

I remember we had a type of test called a "repaint test". Not sure if they are still working, but we had some of them at one time. I remember Dan Bernstein working on one years back.
Comment 15 zalan 2022-03-02 11:14:54 PST
(In reply to Darin Adler from comment #14)
> Comment on attachment 453624 [details]
> Patch for landing
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=453624&action=review
> 
> > Source/WebCore/ChangeLog:12
> > +        No new test for this, I'm not sure how to write one since the issue is failing to
> > +        repaint during an animation but WKTR seems to force a repaint for reftests.
> 
> I remember we had a type of test called a "repaint test". Not sure if they
> are still working, but we had some of them at one time. I remember Dan
> Bernstein working on one years back.
We still do use them. LayoutTest/fast/repaint has many examples (Internals::startTrackingRepaints etc.).
Comment 16 Simon Fraser (smfr) 2022-03-02 11:17:48 PST
The changelog went stale. This landed with a test.
Comment 17 Antoine Quint 2022-03-02 13:41:00 PST
(In reply to Simon Fraser (smfr) from comment #16)
> The changelog went stale. This landed with a test.

Apologies for the confusion. Simon had educated me about repaint tests on the WebKit slack and I failed to update the text in the ChangeLog.