Bug 145614

Summary: Viewport unit values affected by Command-+ zoom
Product: WebKit Reporter: Joey Hoer <me>
Component: CSSAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: alicia.gonzalez.90, asher, bruno, commit-queue, dino, eoconnor, ews-watchlist, me, rniwa, simon.fraser, webkit-bug-importer, zalan, zanona
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.10   
See Also: https://bugs.webkit.org/show_bug.cgi?id=253540
Attachments:
Description Flags
Rendering comparison between browsers
none
Patch
none
Archive of layout-test-results from ews101 for mac-elcapitan
none
Archive of layout-test-results from ews104 for mac-elcapitan-wk2
none
Patch none

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.