Bug 275698 - Elements visible during transition, disappear after transition, but are still interactive
Summary: Elements visible during transition, disappear after transition, but are still...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Safari 17
Hardware: Mac (Apple Silicon) macOS 14
: P2 Normal
Assignee: Nobody
URL: https://web.archive.org/web/202406181...
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2024-06-20 10:52 PDT by Matt Sephton
Modified: 2024-09-09 12:17 PDT (History)
9 users (show)

See Also:


Attachments
screen recording of issue (2.39 MB, video/mp4)
2024-06-20 10:52 PDT, Matt Sephton
no flags Details
Test reduction (1.43 KB, text/html)
2024-06-25 21:20 PDT, Simon Fraser (smfr)
no flags Details
More self-explanatory test case (1.65 KB, text/html)
2024-09-09 12:17 PDT, Simon Fraser (smfr)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Sephton 2024-06-20 10:52:13 PDT
Created attachment 471712 [details]
screen recording of issue

Elements visible during transition, disappear after transition, but are still interactive

TEST URL
https://blog.gingerbeardman.com/2024/06/18/tetris-heavenly-scrolls/

Wait or click to view any of the slides other than the first or last.

SETUP
- macOS 14.5
- Apple M1 Pro

BROKEN (elements disappear after transition)
- iOS: Safari 17.5.1
- macOS: Safari 17.5
- macOS: Safari TP 196, 195, 193, 189, 185, 183, 181, 179, 177, 173

WORKING (elements remain visible)
- macOS: Chrome 126
- macOS: Opera 110
Comment 1 Matt Sephton 2024-06-20 13:28:15 PDT
My workaround is to put: translateZ(0) 
nto the CSS of the elements that were disappearing. 

I have no idea why this is required only in Safari.

The example URL in the meta data of this issue has been updated to be an archived copy of the problematic site, as I have now rolled out this workaround.
Comment 2 Radar WebKit Bug Importer 2024-06-24 10:29:46 PDT
<rdar://problem/130425260>
Comment 3 Simon Fraser (smfr) 2024-06-24 16:46:37 PDT
The arrows and carousel indicator are missing; looks like a z-ordering issue.
Comment 4 Matt Sephton 2024-06-25 05:17:53 PDT
The arrows and carousel indicator are missing, but only sometimes; not on the first and last slide and crucially not during the transition itself.

Z-ordering does appear to be the case given the workaround.
Comment 5 Simon Fraser (smfr) 2024-06-25 11:31:11 PDT
Removing the wrapping ` c-off-canvas-container` (or removing its transform) is a workaround.
Comment 6 Matt Sephton 2024-06-25 15:52:52 PDT
Interesting, thanks. 

Is there any insight into what the regression or change is that means this is only broken in Safari?
Comment 7 Simon Fraser (smfr) 2024-06-25 21:20:00 PDT
Created attachment 471744 [details]
Test reduction
Comment 8 Simon Fraser (smfr) 2024-06-26 21:59:25 PDT
This is a bug in the overlap logic (LayerOverlapMap).

In a version of the test case, this is the layer hierarchy:

-S---------C-c-- -- -b--h- -gkc-s 9 9 0x179000860 (0,0) width=883 height=1144 [SA 0x104095180] (layerID 466) {sc ProcessQualified(470, 10)} RenderView 0x1790002c0
-S-----------c-- -- -b--h- ---c-- 9 9   + 0x179001680 (0,0) width=883 height=688 [SA 0x104096060] RenderBlock 0x179001520 HTML 0x179006930
-S-----T---C-c-- -- -b--h- -gkcx- 9 9     + 0x179003980 (8,8) width=867 height=672 (layerID 472) RenderBlock 0x179003820 DIV 0x179007160 class='transformed-container'
-S-----T---C---t -- ------ -gkcx- 9 9       + 0x179003c30 (492,21) width=54 height=54 (layerID 473) RenderBlock (positioned) 0x179003ad0 DIV 0x1790071e0 class='abspos'
-S-----T---C-c-t -- -b--h- -gkcx- 9 9       + 0x179004360 (11,11) width=400 height=600 (layerID 477) graphical effect RenderBlock 0x179004200 DIV 0x1790073c0 class='translated'
-S-----T-------t -- ------ -g---- 9 9         + 0x179004610 (0,0) width=402 height=602 RenderBlock (positioned) 0x1790044b0 DIV 0x1790075a0 class='slide'
-S-----T---C---t -- ------ -gkcx- 9 9         + 0x1790048c0 (0,0) width=402 height=602 (layerID 476) overlap RenderBlock (positioned) 0x179004760 DIV 0x179007700 class='right slide'
-S-------------t -- ------ -g---- 9 9       + 0x1790040b0 (21,21) width=200 height=200 RenderBlock (positioned) 0x179003d80 DIV 0x179007340 class='above'


0x1790040b0 is the green box that ends up underneath (the arrows in the original content). We fail to composite it because we fail to detect that it's above 0x179004610. And that happens because when we add 0x179004610 to the overlap map, we haven't yet determined that 0x179004360 will be composited, which only happens after descendant traversal (in the "    // Now check for reasons to become composited that depend on the state of descendant layers" clause).

So we add the bounds of 0x179004610 to the overlap map in the scope of 0x179000860 rather than the scope of 0x179004360. This implies that overlap testing is broken whenever we make post-descendant compositing decisions.
Comment 9 Matt Sephton 2024-06-27 03:40:07 PDT
Thanks for the extra info. 

For my own sanity I'd love to know how long it's been like this? I could say it once worked fine, but I can't be sure.
Comment 10 Simon Fraser (smfr) 2024-09-09 12:17:07 PDT
Created attachment 472506 [details]
More self-explanatory test case