Bug 127090 - [WK2] Setting m_pageScaleFactor directly in WebPageProxy::scalePage
Summary: [WK2] Setting m_pageScaleFactor directly in WebPageProxy::scalePage
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Thiago de Barros Lacerda
URL:
Keywords:
: 126261 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-01-16 02:16 PST by Thiago de Barros Lacerda
Modified: 2014-01-20 15:34 PST (History)
5 users (show)

See Also:


Attachments
Patch (1.57 KB, patch)
2014-01-16 04:07 PST, Thiago de Barros Lacerda
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thiago de Barros Lacerda 2014-01-16 02:16:30 PST
When the client side sets the scale factor, the UIProcess will send the message to WebProcess and only after WebPageProxy::pageScaleFactorDidChange is called the desired scale factor is returned correctly by WebPageProxy::pageScaleFactor.
This will avoid the client side retrieve a wrong scale factor while UIProcess and WebProcess gets synchronized.
Comment 1 Thiago de Barros Lacerda 2014-01-16 02:19:35 PST
*** Bug 126261 has been marked as a duplicate of this bug. ***
Comment 2 Thiago de Barros Lacerda 2014-01-16 04:07:17 PST
Created attachment 221363 [details]
Patch
Comment 3 Simon Fraser (smfr) 2014-01-20 11:36:49 PST
(In reply to comment #0)
> When the client side sets the scale factor, the UIProcess will send the message to WebProcess and only after WebPageProxy::pageScaleFactorDidChange is called the desired scale factor is returned correctly by WebPageProxy::pageScaleFactor.
> This will avoid the client side retrieve a wrong scale factor while UIProcess and WebProcess gets synchronized.

What's the user-visible symptom of getting the wrong scale factor in the UI process?
Comment 4 Thiago de Barros Lacerda 2014-01-20 13:18:52 PST
(In reply to comment #3)
> (In reply to comment #0)
> > When the client side sets the scale factor, the UIProcess will send the message to WebProcess and only after WebPageProxy::pageScaleFactorDidChange is called the desired scale factor is returned correctly by WebPageProxy::pageScaleFactor.
> > This will avoid the client side retrieve a wrong scale factor while UIProcess and WebProcess gets synchronized.
> 
> What's the user-visible symptom of getting the wrong scale factor in the UI process?

I can imagine a scenario that the user double clicks the WebView, in order to zoom the page, then WKViewSetContentScaleFactor gets called. Right after that it may need to set the position of the contents inside the view, so it gets centralized where the user has clicked. Without this patch he will not get the correct scale factor and the position may not be set correctly, unless the user caches the scale, which in my opinion is just an unnecessary duplication of information.
Besides that, I think is not good to have the UIProcess in a inconsistent state with the WebProcess, even for a short period of time.
Comment 5 WebKit Commit Bot 2014-01-20 15:34:53 PST
Comment on attachment 221363 [details]
Patch

Clearing flags on attachment: 221363

Committed r162382: <http://trac.webkit.org/changeset/162382>
Comment 6 WebKit Commit Bot 2014-01-20 15:34:56 PST
All reviewed patches have been landed.  Closing bug.