New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 632323 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Feature request: Updates to zoom levels

Reported by jleedev@gmail.com, Jul 28 2016

Issue description

Chrome Version : 52.0.2743.82 (Official Build) beta (64-bit)

This is two feature requests regarding the list of zoom levels available.

1. Change 0.333 and 0.666 to be more precisely 1/3 and 2/3.
2. Add an 80% zoom level.

The goal is to allow zooming out on a HiDPI display to more precisely align to pixels. To ensure that devicePixelRatio is a whole number or nice fraction. If you’re convinced as to why this is desirable, you may stop reading now.

Windows users who are accustomed to the old behavior of ignoring 125% zoom will be able to set the default page zoom to 80% in preferences. Adding this item to the list is certainly the simplest way of restoring this feature for those users.

This mainly applies on Windows and Linux, as well as Chrome OS, which ships certain devices at 1.25dppx. Mac OS only scales in integer multiples, but a hypothetical 3x (virtual, like iPhone Plus) display would still benefit from exact 1/3 zoom.

Current behavior:
At 1.5x scale and 0.666 zoom, the product of zoom and dsf should be 0.999. (It’s actually 0.9990000128746033 because apparently this number is converted to single precision at some point.)
At 1.25x scale and 0.666 zoom, the product of zoom and dsf should be 0.8325 (actually 0.8324999809265137). Under these conditions I can reliably produce a blurry image.

Desired behavior:
At 1.5x scale and 0.666666666666666 zoom, the product of zoom and dsf should be exactly 1.
At 1.25x scale and 0.666666666666666 zoom, the product of zoom and dsf should be 0.8(3) repeating, which behaves nicely (it's exactly 80 dpi).

Potential drawbacks:

1. Most media queries should be using a range and not checking if devicePixelRatio is exactly 1; there’s little purpose to this. Even though 0.999 will cause an error of 1 pixel every 1000, I can’t actually get a consistently blurry picture under these circumstances. Still, this is already a floating-point constant, so changing it should not be an issue. The benefits are more noticeable for 1.25x users than for 1.5x.

2. Adding 0.8 puts the zoom steps closer together. I believe this is OK; it actually makes the consecutive ratios in that range match the ratios at the larger end, and I really think having multiplicative inverses is beneficial.

With enable-use-zoom-for-dsf launching, my test page is a lot less blurry than it was in the past, but it’s still noticeable. Visit https://twister.43foldrs.com/dp/dp.html and zoom the page in and out to see. The picture is consistently blurry with dsf set to 1.25 and zoom set to 0.666, and using an extension to set the zoom to exactly 2/3 cleans up the image. In principle, this same improvement will be seen on any image whose dimensions are a multiple of 6, in this case.
 
Cc: ranjitkan@chromium.org
Components: UI>Browser>Zoom
Untraiging it so that it gets addressed.

Comment 2 by bsep@chromium.org, Aug 10 2016

Cc: bsep@chromium.org

Comment 3 by bsep@chromium.org, Aug 19 2016

Cc: -bsep@chromium.org
Labels: -Pri-3 M-54 Pri-2
Owner: bsep@chromium.org
Status: Assigned (was: Unconfirmed)
I've been thinking about this and I think request #2 is really important for M54, since I enabled 125% dsf on Windows and it's a popular scale factor.

I'll look at doing #1 but it's not my focus.

Comment 4 by bsep@chromium.org, Aug 23 2016

Status: Fixed (was: Assigned)
Not sure why there's no automated comment but I landed https://codereview.chromium.org2263733002 for this, which fixes both of the issues.

Comment 5 by bsep@chromium.org, Aug 23 2016

Sorry that link is https://codereview.chromium.org/2263733002

Comment 6 by jleedev@gmail.com, Aug 23 2016

Yay!

Comment 8 by bsep@chromium.org, Aug 24 2016

Status: Started (was: Fixed)
dang it
Project Member

Comment 9 by bugdroid1@chromium.org, Aug 25 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/24e7ec450709151344f63e2b273ec5266e1426f6

commit 24e7ec450709151344f63e2b273ec5266e1426f6
Author: bsep <bsep@chromium.org>
Date: Thu Aug 25 02:11:20 2016

Add 80% and 250% zoom level to settings.

https://codereview.chromium.org/2263733002 added 80% zoom to the list of presets, but I forgot it in the settings dropdown. And it looks like 250% was missing from the settings too, for some reason. I can't find anything to indicate this was intentional, so I included it as well. Also updated the comments so that no one else makes this mistake.

BUG= 632323 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2278783002
Cr-Commit-Position: refs/heads/master@{#414251}

[modify] https://crrev.com/24e7ec450709151344f63e2b273ec5266e1426f6/chrome/browser/resources/pdf/viewport.js
[modify] https://crrev.com/24e7ec450709151344f63e2b273ec5266e1426f6/chrome/browser/resources/settings/appearance_page/appearance_page.js
[modify] https://crrev.com/24e7ec450709151344f63e2b273ec5266e1426f6/components/zoom/page_zoom_constants.cc

Comment 10 by bsep@chromium.org, Aug 25 2016

Status: Fixed (was: Started)

Sign in to add a comment