[wk2] Scroll pinning state is wrong until the first scroll event

https://bugs.webkit.org/show_bug.cgi?id=127437

Reviewed by Simon Fraser.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::didChangeScrollOffset):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updateMainFrameScrollOffsetPinning):
(WebKit::WebPage::didCommitLoad):
* WebProcess/WebPage/WebPage.h:
Rename WebPage::didChangeScrollOffsetForMainFrame to
updateMainFrameScrollOffsetPinning, which better describes what it
actually does. Call it when a load is committed, so that we have valid
pinning state before the first scroll event comes in.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162548 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 332743e3
2014-01-22 Tim Horton <timothy_horton@apple.com>
[wk2] Scroll pinning state is wrong until the first scroll event
https://bugs.webkit.org/show_bug.cgi?id=127437
Reviewed by Simon Fraser.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::didChangeScrollOffset):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updateMainFrameScrollOffsetPinning):
(WebKit::WebPage::didCommitLoad):
* WebProcess/WebPage/WebPage.h:
Rename WebPage::didChangeScrollOffsetForMainFrame to
updateMainFrameScrollOffsetPinning, which better describes what it
actually does. Call it when a load is committed, so that we have valid
pinning state before the first scroll event comes in.
2014-01-22 Anders Carlsson <andersca@apple.com> 2014-01-22 Anders Carlsson <andersca@apple.com>
Add WKWebViewConfiguration class Add WKWebViewConfiguration class
......
...@@ -1551,7 +1551,7 @@ void WebFrameLoaderClient::didChangeScrollOffset() ...@@ -1551,7 +1551,7 @@ void WebFrameLoaderClient::didChangeScrollOffset()
if (!m_frame->coreFrame()->view()) if (!m_frame->coreFrame()->view())
return; return;
webPage->didChangeScrollOffsetForMainFrame(); webPage->updateMainFrameScrollOffsetPinning();
} }
bool WebFrameLoaderClient::allowScript(bool enabledPerSettings) bool WebFrameLoaderClient::allowScript(bool enabledPerSettings)
......
...@@ -3004,7 +3004,7 @@ void WebPage::clearSelection() ...@@ -3004,7 +3004,7 @@ void WebPage::clearSelection()
m_page->focusController().focusedOrMainFrame().selection().clear(); m_page->focusController().focusedOrMainFrame().selection().clear();
} }
void WebPage::didChangeScrollOffsetForMainFrame() void WebPage::updateMainFrameScrollOffsetPinning()
{ {
Frame& frame = m_page->mainFrame(); Frame& frame = m_page->mainFrame();
IntPoint scrollPosition = frame.view()->scrollPosition(); IntPoint scrollPosition = frame.view()->scrollPosition();
...@@ -3953,6 +3953,8 @@ void WebPage::didCommitLoad(WebFrame* frame) ...@@ -3953,6 +3953,8 @@ void WebPage::didCommitLoad(WebFrame* frame)
#endif #endif
WebProcess::shared().updateActivePages(); WebProcess::shared().updateActivePages();
updateMainFrameScrollOffsetPinning();
} }
void WebPage::didFinishLoad(WebFrame* frame) void WebPage::didFinishLoad(WebFrame* frame)
......
...@@ -581,7 +581,7 @@ public: ...@@ -581,7 +581,7 @@ public:
void setMediaVolume(float); void setMediaVolume(float);
void setMayStartMediaWhenInWindow(bool); void setMayStartMediaWhenInWindow(bool);
void didChangeScrollOffsetForMainFrame(); void updateMainFrameScrollOffsetPinning();
void mainFrameDidLayout(); void mainFrameDidLayout();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment