ResizeObserver returns double size on high dpi desktop
Reported by
dennis.h...@wecode.se,
May 22 2017
|
|||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Steps to reproduce the problem: 1. var o = new ResizeObserver(()=> console.log(entries[0].contentRect.width)) 2. o.observer(domElement) 3. compare with domElement.clientWidth What is the expected behavior? clientWidth and the ResizeObserverEntry.contentRect.width should be comparable What went wrong? The ResizeObserverEntry appears to report width and height in physical pixels instead of css pixels Did this work before? N/A Does this work in other browsers? N/A Chrome version: 58.0.3029.110 Channel: stable OS Version: 10.0 Flash Version:
,
May 23 2017
,
Aug 11 2017
HighDPI works correctly. Scaled content does not work.
,
Aug 21 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/412b57a9cf766ec23db7256a9ca3d77e2a13276e commit 412b57a9cf766ec23db7256a9ca3d77e2a13276e Author: Aleks Totic <atotic@chromium.org> Date: Mon Aug 21 21:55:01 2017 Scale contentRect by zoom Reported size should be in CSS pixels, not physical, zoomed pixels. Added a test case. Also fixed existing iframe test. The existing test was incorrect. Bug: 724971 Change-Id: I2f36429f08c6ab68b99d8754e9ddba9599c08348 Reviewed-on: https://chromium-review.googlesource.com/614108 Reviewed-by: Anton Vayvod <avayvod@chromium.org> Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org> Reviewed-by: Emil A Eklund <eae@chromium.org> Commit-Queue: Aleks Totic <atotic@chromium.org> Cr-Commit-Position: refs/heads/master@{#496072} [modify] https://crrev.com/412b57a9cf766ec23db7256a9ca3d77e2a13276e/third_party/WebKit/LayoutTests/resize-observer/observe.html [modify] https://crrev.com/412b57a9cf766ec23db7256a9ca3d77e2a13276e/third_party/WebKit/LayoutTests/resize-observer/resources/iframe.html [add] https://crrev.com/412b57a9cf766ec23db7256a9ca3d77e2a13276e/third_party/WebKit/LayoutTests/resize-observer/zoom.html [modify] https://crrev.com/412b57a9cf766ec23db7256a9ca3d77e2a13276e/third_party/WebKit/Source/core/resize_observer/ResizeObserver.cpp [modify] https://crrev.com/412b57a9cf766ec23db7256a9ca3d77e2a13276e/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp
,
Aug 21 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by ligim...@chromium.org
, May 22 2017Labels: Needs-Triage-M58