Bug 32801 - Don't shrink by default always when zoom in/out is enabled for standalone images
Summary: Don't shrink by default always when zoom in/out is enabled for standalone images
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-20 12:34 PST by Mario Sanchez Prada
Modified: 2014-07-24 06:45 PDT (History)
1 user (show)

See Also:


Attachments
Patch for proposal 1 (12.27 KB, patch)
2009-12-20 13:13 PST, Mario Sanchez Prada
no flags Details | Formatted Diff | Diff
Patch for proposal 2 (5.20 KB, patch)
2009-12-20 13:14 PST, Mario Sanchez Prada
no flags Details | Formatted Diff | Diff
Patch for proposal 1 (13.04 KB, patch)
2010-06-14 09:11 PDT, Mario Sanchez Prada
abarth: review-
Details | Formatted Diff | Diff
Patch for proposal 2 (3.75 KB, patch)
2010-06-14 09:33 PDT, Mario Sanchez Prada
abarth: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mario Sanchez Prada 2009-12-20 12:34:18 PST
DESCRIPTION:

Currently the ShrinksStandaloneImagesToFit setting in WebCore::Settings controls two things at the same time:

  - Whether an standalone image should show up automatically resized to window size when loaded
  - Whether it's possible to zoom in (and out) the image by clicking on top of it

So, if you now set that setting to 'true' you'll get that all standalone images will appear shrunk to window size by default, and clicking on them will enlarge them. However if you set it to 'false' the image will appear in 1:1 ratio *and* clicking on top of it will get no effect (no zoom out as the handler won't be even installed).

This means so far it's impossible to render standalone images to the 1:1 ratio by default while still being able to click on top of them to zoom in/out the image, as using 'true' will shrink by default and using 'false' will not install the mouse click handler for that.

Check epiphany bug 599997 for more details about the motivation of this bug (https://bugzilla.gnome.org/show_bug.cgi?id=599997)

PROPOSAL:

Basically I'd see two ways to fix this:

  1. Keep the same meaning for ShrinksStandaloneImagesToFit values and just *add a new setting* to control the initial status of an image when shrinking is activated: initially shrink it or not.

  2. Change the meaning of ShrinksStandaloneImagesToFit setting so it would control *only* whether the image is initially shrank or not, having the handler for the zoom in/out thing always installed.


The main advantage of (1) is that it doesn't affect to the behaviour of already existing applications, just extends the possibilities with a new setting (but adding a new setting could be seen as a disavantage also).

The main advantage of (2) is that it would keep things more simple, although it would be needed to take the change into account in already existing apps, and it would make impossible to disable the zoom.

I have patches for both the two possibilities but I'm not sure which one is the most correct one bearing in mind all the platforms, so opinions? (I'll attach patches right away)
Comment 1 Mario Sanchez Prada 2009-12-20 13:13:27 PST
Created attachment 45291 [details]
Patch for proposal 1

(In reply to comment #0)
> [...]
>   1. Keep the same meaning for ShrinksStandaloneImagesToFit values and just
> *add a new setting* to control the initial status of an image when shrinking is
> activated: initially shrink it or not.

Attached patch would implement this proposal
Comment 2 Mario Sanchez Prada 2009-12-20 13:14:47 PST
Created attachment 45292 [details]
Patch for proposal 2

(In reply to comment #0)
> [...]
>   2. Change the meaning of ShrinksStandaloneImagesToFit setting so it would
> control *only* whether the image is initially shrank or not, having the handler
> for the zoom in/out thing always installed.

Attached patch would implement this
Comment 3 Alexey Proskuryakov 2010-06-12 15:58:47 PDT
This patch has been overlooked, because it isn't marked for review. Please see <http://webkit.org/coding/contributing.html> for more detail.
Comment 4 Mario Sanchez Prada 2010-06-14 02:06:31 PDT
(In reply to comment #3)
> This patch has been overlooked, because it isn't marked for review. Please see <http://webkit.org/coding/contributing.html> for more detail.

Sorry, I'll rebuild the patches against the last version of trunk and will add review flags for both of them this time, although obviously, only one of those would get in  in the best case :-)
Comment 5 Mario Sanchez Prada 2010-06-14 09:11:40 PDT
Created attachment 58659 [details]
Patch for proposal 1 

Here you have a patch for the first proposal done against the latest version of trunk.

Personally, this is the option I like the most, but do not pay much attention to that, just let me know what you think both of the proposal and the implementation :-)
Comment 6 Mario Sanchez Prada 2010-06-14 09:33:12 PDT
Created attachment 58662 [details]
Patch for proposal 2

...and here is the new patch for the second proposal
Comment 7 Mario Sanchez Prada 2010-08-04 03:25:51 PDT
This has been stuck for quite a long time and I wonder whether I should do something else other than ping people or keep commenting.

Adding Xan Lopez to CC, as he's the maintainer of Epiphany browser, which depends on this bug to get https://bugzilla.gnome.org/show_bug.cgi?id=599997 fixed.
Comment 8 Adam Barth 2010-10-10 11:22:31 PDT
Comment on attachment 58659 [details]
Patch for proposal 1 

There doesn't seem to be much interested in this patch.  R- for lack of tests.
Comment 9 Adam Barth 2010-10-10 11:22:47 PDT
Comment on attachment 58662 [details]
Patch for proposal 2

No tests.
Comment 10 Mario Sanchez Prada 2010-10-21 08:39:32 PDT
Thanks Adam for reviewing the patches.

The lack of tests is a shame, actually, but I wrote those patches almost one year ago when I barely knew what a Layout Test was, so I'm not surprised I didn't add any... :-)

Anyway, now I'm busy fixing those bugs related to accessibility in the GTK port so I don't think I'll work for a while on this bug (hope that's ok), unless I find some contiguous spare time at some point to focus on that, but that will be unlikely until december, I'm afraid :-(

Once again, thanks a lot for reviewing it. Now I have a clear lead to follow to get this fixed.
Comment 11 Mario Sanchez Prada 2014-07-24 06:45:35 PDT
I think 4 years, together with the fact that this patch does not apply any more, is prudent enough to resolve this as a won't fix.