Bug 212373 - ResizeObserver doesn't trigger for elements with size in viewport values on window zoom
Summary: ResizeObserver doesn't trigger for elements with size in viewport values on w...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: Safari 13
Hardware: Mac macOS 10.15
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-05-26 06:55 PDT by Golubov Nikita
Modified: 2022-10-03 12:12 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Golubov Nikita 2020-05-26 06:55:57 PDT
1. Make a div with width in vw and height in vh
2. Create ResizeObserver and observe this div
3. Zoom browser window

Showcase: https://jsfiddle.net/yLdvctzx/14/show
Code: https://jsfiddle.net/yLdvctzx/14

Expected behavior:
ResizeObserver should detect resizing of the div and trigger its handler because elements's size in pixels has changed after zoom.

Actual behavior:
ResizeObserver doesn't trigger handler.
In the showcase example you can see that dimensions doesn't update on widnow resize.
Video demonstration: https://monosnap.com/file/WbacIuL2djfoCDiUE8Q5weaH1j1HEL

Chromium has the same issue (https://bugs.chromium.org/p/chromium/issues/detail?id=1086465). Works if FireFox.
Comment 1 Radar WebKit Bug Importer 2020-05-26 18:16:49 PDT
<rdar://problem/63653855>
Comment 2 Simon Fraser (smfr) 2022-10-03 12:12:21 PDT
Does this reproduce in a recent Safari Tech Preview? There have been some fixes in this area.