209947 – Twitter feed contents overlap when changing the zoom level (caused by R...
source link: https://bugs.webkit.org/show_bug.cgi?id=209947
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
WebKit Bugzilla
Bug 209947 - Twitter feed contents overlap when changing the zoom level (caused by ResizeObserver)
Reported: 2020-04-02 19:57 PDT by Simon Fraser (smfr)
Modified: 2020-04-13 09:32 PDT (History) CC List: 7 users (show)
Attachments Screenshot
(648.29 KB, image/png)
Simon Fraser (smfr)
no flags
(6.58 KB, patch)
cathiechen
no flags
| Diff
Show Obsolete (1) View All Add an attachment (proposed patch, testcase, etc.)
Load https://twitter.com/explore. Zoom out with Command--. Note how elements on the timeline now overlap. Does not happen in Chrome.
The feed is a series of absolutely positioned boxes, offset with translateY() transforms. Those offsets are computing using ResizeObserver. ResizeObserver doesn't seem to fire callbacks when the zoom level changes, so those translateY() don't change. They do in Chrome.
Created attachment 395339 [details] Screenshot
It's also possible that the sizes being reported by ResizeObserver fail to take zoom into account.
That might be similar to bug 209264.
Created attachment 395457 [details] Patch
Comment on attachment 395457 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=395457&action=review > Source/WebCore/ChangeLog:8 > + Zoom in/out shouldn't affect ResizeObserver. Use adjustLayoutUnitForAbsoluteZoom instead. Is the bug that its was triggering resizeObserver? Does Command-+ zooming affect getBoundingClientRect results? > LayoutTests/imported/w3c/ChangeLog:9 > + * web-platform-tests/resize-observer/resize-observer-with-zoom-expected.txt: Added. > + * web-platform-tests/resize-observer/resize-observer-with-zoom.html: Added. New WPT tests should go into http/wpt so they get upstreamed. > LayoutTests/imported/w3c/web-platform-tests/resize-observer/resize-observer-with-zoom.html:35 > + window.internals.setPageZoomFactor(2); I don't think a WPT test can use window.internals.setPageZoomFactor
Comment on attachment 395457 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=395457&action=review Hi Simon, Thanks for the review:) >> Source/WebCore/ChangeLog:8 >> + Zoom in/out shouldn't affect ResizeObserver. Use adjustLayoutUnitForAbsoluteZoom instead. > > Is the bug that its was triggering resizeObserver? Does Command-+ zooming affect getBoundingClientRect results? Ah, it should be "don't affect ResizeObserver size" here. "ResizeObserver size" matters, not triggering notification. Command-+ doesn't affect getBoundingClientRect, and I would add a svg test case for it. >> LayoutTests/imported/w3c/ChangeLog:9 >> + * web-platform-tests/resize-observer/resize-observer-with-zoom.html: Added. > > New WPT tests should go into http/wpt so they get upstreamed. I see, I usually upload the test by github, will try this next time. >> LayoutTests/imported/w3c/web-platform-tests/resize-observer/resize-observer-with-zoom.html:35 >> + window.internals.setPageZoomFactor(2); > > I don't think a WPT test can use window.internals.setPageZoomFactor Hmm, I can't find a similar interface in WPT, maybe we can move the test to /LayoutTests/resize-observer/resize-observer-with-zoom.html instead?
Created attachment 395489 [details] Patch
Committed r259578: <https://trac.webkit.org/changeset/259578> All reviewed patches have been landed. Closing bug and clearing flags on attachment 395489 [details].
*** Bug 210432 has been marked as a duplicate of this bug. ***
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK