RESOLVED DUPLICATE of bug 280759286062
Changing fixed position to static does not recalculate parent size
https://bugs.webkit.org/show_bug.cgi?id=286062
Summary Changing fixed position to static does not recalculate parent size
WS Work
Reported 2025-01-16 06:45:59 PST
Created attachment 473922 [details] Video showing behaviour on chrome (first) and then safari. Summary: When changing the CSS position property of a child element from fixed to static, the parent element’s width is not recalculated immediately on Safari (WebKit). The recalculation occurs after an unusual delay (10+ seconds) or after some other interactions. This behaviour differs from other browsers like Chrome and Firefox, where the recalculation happens instantly. --- Steps to Reproduce: Just visit demo at: https://stackblitz.com/edit/stackblitz-starters-3bqjvujk?file=index.html --- Expected Behaviour: The parent container (with blue outline) should immediately recalculate its width based on the size of the sidebar when its position changes from fixed to static (e.g., during the lock state). --- Actual Behavior: On Safari (WebKit): The parent container does not immediately adjust its width when the sidebar’s position changes from fixed to static. The recalculation happens after an unusual delay. On Chrome and Firefox: The parent container recalculates its width instantly when the sidebar’s position changes from fixed to static. --- Test Case: https://stackblitz.com/edit/stackblitz-starters-3bqjvujk?file=index.html Formerly i discovered this bug when using custom elements - inside shadow-dom - that's why demo contains standard and shadow-dom version. --- Observed on: MacOS Safari 18.0 (20619.1.26.31.6) --- Additional Notes: This issue affects layouts that rely on parent containers dynamically adjusting their size based on child elements. It introduces inconsistency in behavior across browsers and causes delayed visual feedback for users in Safari. Please let me know if further clarification or testing is required. Thank you! --- Attachements: video showing behaviour on chrome (first) and then safari.
Attachments
Video showing behaviour on chrome (first) and then safari. (1.61 MB, video/mp4)
2025-01-16 06:45 PST, WS Work
no flags
Mateusz Daniluk
Comment 1 2025-01-17 05:40:46 PST
It looks like this issue has been resolved in the latest version of WebKit. I tested the case of changing position from fixed to static, and the parent container's width is now recalculated immediately, as expected. Tested on: commit 778c00cc651d4811b2137f2bade7849ca04017e1 Safari (WebKit): 18.2 (20620.1.16.11.8, 621+) macOS: 15.2 (24C101)
alan
Comment 2 2025-01-17 06:32:05 PST
Thank you for confirming that this is fixed in 18.2. This has progressed at 284679@main.
alan
Comment 3 2025-01-17 06:32:23 PST
*** This bug has been marked as a duplicate of bug 280759 ***
Note You need to log in before you can comment on or make changes to this bug.