[BlackBerry][Fullscreen] Exiting fullscreen does not set the correct scroll position
authorzhajiang@rim.com <zhajiang@rim.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Dec 2012 15:33:11 +0000 (15:33 +0000)
committerzhajiang@rim.com <zhajiang@rim.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Dec 2012 15:33:11 +0000 (15:33 +0000)
commite05e4e0a5a0d2be38515dad70387300dfe25dce2
treed68b7114a2fa57eec7a14960e26fcf546877778d
parent14cd14439035118d0400240cfdcfbdb2dfd7cd2f
[BlackBerry][Fullscreen] Exiting fullscreen does not set the correct scroll position
https://bugs.webkit.org/show_bug.cgi?id=104958

Patch by Jacky Jiang  <zhajiang@rim.com>.
Reviewed by Antonio Gomes.
Internally reviewed by Arvid Nilsson and Max Feil.

PR: 231174
When leaving fullscreen, WebPage scale and scroll position can't return
to the original scale and scroll position.
We can't restore them in WebPagePrivate::exitFullScreenForElement()
as they can still be changed thereafter during the async
setViewportSize(). And also the async setViewportSize() from the app
side isn't guaranteed as some apps don't need to resize the viewport if
their windows are already fullscreen.
The restoration is basically only needed if viewport size is changed.
At the point of entering fullscreen, we can safely assume that there
would be a viewport size change thereafter if the current visible size
and screen size are not equal. Based on this assumption, we can save
the scale and position before entering fullscreen and restore them in
setViewportSize() thereafter.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::WebPagePrivate):
(BlackBerry::WebKit::WebPagePrivate::setViewportSize):
* Api/WebPage_p.h:
(WebPagePrivate):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@137743 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/blackberry/Api/WebPage.cpp
Source/WebKit/blackberry/Api/WebPage_p.h
Source/WebKit/blackberry/ChangeLog