Bug 145614 - Viewport unit values affected by Command-+ zoom
Summary: Viewport unit values affected by Command-+ zoom
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.10
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-06-03 13:32 PDT by Joey Hoer
Modified: 2023-03-07 18:48 PST (History)
13 users (show)

See Also:


Attachments
Rendering comparison between browsers (2.36 MB, image/png)
2015-06-03 13:32 PDT, Joey Hoer
no flags Details
Patch (8.17 KB, patch)
2017-11-28 21:32 PST, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews101 for mac-elcapitan (2.22 MB, application/zip)
2017-11-28 22:28 PST, EWS Watchlist
no flags Details
Archive of layout-test-results from ews104 for mac-elcapitan-wk2 (2.61 MB, application/zip)
2017-11-28 22:40 PST, EWS Watchlist
no flags Details
Patch (7.65 KB, patch)
2017-11-28 22:42 PST, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joey Hoer 2015-06-03 13:32:16 PDT
Created attachment 254203 [details]
Rendering comparison between browsers

When the browser zoom is zoomed (in or out), viewport unit values are affected, and are no longer relative to the physical viewport. This can lead to layout issues.

This behaves as expected in Chrome and Firefox.

See http://codepen.io/joeyhoer/full/BcbsH/ for a demo.
Comment 1 Simon Fraser (smfr) 2015-08-11 14:04:56 PDT
Does this still reproduce in a WebKit nightly?
Comment 2 Joey Hoer 2015-08-11 14:28:22 PDT
Yes this issue is still present in WebKit r188253

(In reply to comment #1)
> Does this still reproduce in a WebKit nightly?
Comment 3 Simon Fraser (smfr) 2015-08-11 14:47:28 PDT
I cannot reproduce. By "browser zoom" do you mean pinch-zoom on the trackpad?
Comment 4 hexalys 2015-08-11 16:15:38 PDT
http://codepen.io/hexalys/full/XbGvvW(In reply to comment #3)
> I cannot reproduce. By "browser zoom" do you mean pinch-zoom on the trackpad?

Joey's example is is not very clear. Here is simple layout with VW units.
http://codepen.io/hexalys/full/XbGvvW

As you zoom in with CMD +, you can see that the VM units remains based on a 100% zoom. e.g. 50% of the viewport width become 75% at 150% zoom etc..

Other browsers will adjust VW units to the rescaled viewport width
according to the zoom ratio.

Without that adjustment, all responsive layouts will be affected.
Comment 5 Marcus Zanona 2016-04-22 06:27:50 PDT
I can confirm the unexpected behaviour:

http://data:text/html,<div%20style="width:100vw;height:100vh;background:red">

an object with width of 100vw and height of 100vh has it's dimensions changed when zooming in or out the page which is not the expected behaviour.

Firefox seems to implement this accordingly.
Comment 6 Radar WebKit Bug Importer 2016-04-22 10:53:24 PDT
<rdar://problem/25880356>
Comment 7 alicia.gonzalez.90 2017-07-27 04:50:24 PDT
Is there a timeline to fix this issue? :)
Comment 8 Asher 2017-08-29 15:58:02 PDT
Seriously, why isn't this solved yet? It seems a basic premise of viewport-based design, so why is it not being taken seriously after more than 2 full years?
Comment 9 Simon Fraser (smfr) 2017-11-28 21:32:21 PST
Created attachment 327827 [details]
Patch
Comment 10 EWS Watchlist 2017-11-28 22:28:30 PST Comment hidden (obsolete)
Comment 11 EWS Watchlist 2017-11-28 22:28:31 PST Comment hidden (obsolete)
Comment 12 EWS Watchlist 2017-11-28 22:40:22 PST Comment hidden (obsolete)
Comment 13 EWS Watchlist 2017-11-28 22:40:23 PST Comment hidden (obsolete)
Comment 14 Simon Fraser (smfr) 2017-11-28 22:42:32 PST
Created attachment 327836 [details]
Patch
Comment 15 WebKit Commit Bot 2017-11-29 10:59:42 PST
Comment on attachment 327836 [details]
Patch

Clearing flags on attachment: 327836

Committed r225277: <https://trac.webkit.org/changeset/225277>
Comment 16 WebKit Commit Bot 2017-11-29 10:59:44 PST
All reviewed patches have been landed.  Closing bug.