Bug 240582

Summary: REGRESSION (r292400): Animating and focusing a button inside of "overflow: clip" container causes button to disappear
Product: WebKit Reporter: Liam DeBeasi <ldebeasi>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: akeerthi, bfulgham, graouts, koivisto, rego, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Safari 15   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=236782
Attachments:
Description Flags
Code reproduction
none
Code reproduction (with div) none

Description Liam DeBeasi 2022-05-18 09:12:28 PDT
Created attachment 459546 [details]
Code reproduction

Animating and then focusing a button inside of a contain: paint container causes the button to disappear.

Steps to reproduce:

1. Open the attached code reproduction in Safari (iOS or macOS).
2. Click the "Show Menu" button. Observe that a button translates in and then disappears.

Expected Behavior:

I expect the button to remain visible after the animation ends.

Actual Behavior:

The button disappears after the animation ends.

Additional Info:

- I can reproduce this on iOS 15.5 and Safari 15.5.
- This issue only reproduces when the document direction is RTL. LTR works as expected.
- This works as expected on Chrome and Firefox.

There are a couple things that fix the issue:
- Transforming the button using translateX instead of translate3d
- Focusing the button in a requestAnimationFrame
Comment 1 Simon Fraser (smfr) 2022-05-18 09:42:45 PDT
Same as bug 238088?
Comment 2 Liam DeBeasi 2022-05-18 09:50:47 PDT
Created attachment 459547 [details]
Code reproduction (with div)

This appears to be a different issue. The linked issue notes that the behavior only happens on <button> elements and does not happen on <div> elements. The issue reported here reproduces on both.

I attached a new code reproduction showing this. The steps to reproduce are the same.
Comment 3 Antoine Quint 2022-05-20 01:33:01 PDT
(In reply to Simon Fraser (smfr) from comment #1)
> Same as bug 238088?

I don't think so since that bug was fixed in macOS 12.5 but this bug reproduces in this build.
Comment 4 Radar WebKit Bug Importer 2022-05-25 09:13:14 PDT
<rdar://problem/93905731>
Comment 5 zalan 2022-06-02 16:12:16 PDT
Changed the title as this bug repros with "overflow: clip". 
While it regressed at r292400, I think that change just surfaced some old repaint(overflow?) bug here.
Comment 6 Antti Koivisto 2022-08-18 02:32:07 PDT
This doesn't repro for me with trunk Webkit or the current iOS/Mac Safari betas.