Created attachment 260919 [details] Minimal testcase for reproduction. Reproduction: see minimal_testcase_webkit.html, click 'NEW' button. It sets 'NEW' button parent div's 'style.display' to none, but some part of the 'NEW' button isn't repainted/cleared. If 'BACK' button is pressed, the 'NEW' button is correctly repainted/shown back to screen. From my analysis I've found out that for the 'NEW' button, during clearing it from screen, its repaint/dirty rectangle doesn't include an offset from being below '.somespace' div. Yet during painting it back, its repaint rectangle is calculated correctly, and includes the offset (200px). I've tried to find the reason for this difference. Render tree during removing '.somespace' div from screen lacks one anonymous RenderBox, which is present during layouting the div back to screen (as RenderButton parent). Processing this RenderBox in RenderBox.cpp:2233 (computeRectForRepaint(...) - "topLeft.move(locationOffset);") adds mentioned offset. This anonymous RenderBox is removed from the render tree in RenderBlock.cpp:752 (removeChild(...) - "collapseAnonymousBoxChild(*this, downcast<RenderBlock>(child));") earlier in repainting, during processing '.somespace' div's rendertree node. There is a test, which decides whether it is safe to collapseAnonymousBoxChild, but it evaluates to true. If I skip the call to collapseAnonymousBoxChild in a debugger, the button is cleared correctly. 'NEW' button is cleared correctly on Firefox and Chromium. Tested on WebKit MiniBrowserEFL @r189566 on Linux.
Created attachment 260920 [details] Screenshot before clicking 'NEW' button
Created attachment 260921 [details] Screenshot after clicking 'NEW' button, part of the 'NEW' button not cleared from screen
Created attachment 260922 [details] Screenshot, rendered correctly of Firefox
I am able to reproduce this bug in Safari Technology Preview 160, it seems to be painting or invalidation issue where when clicking "Next", it does show both "Back" and "Next" but if I move to different tab or resize then "Next" go away. It works perfectly fine on first try in Chrome Canary 110 and Firefox Nightly 110. Just wanted to share updated testing result. Thanks!