Bug 127090

Summary: [WK2] Setting m_pageScaleFactor directly in WebPageProxy::scalePage
Product: WebKit Reporter: Thiago de Barros Lacerda <thiago.lacerda>
Component: WebKit2Assignee: Thiago de Barros Lacerda <thiago.lacerda>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, commit-queue, jinwoo7.song, simon.fraser, thorton
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

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.