Changeset 83460 in webkit
- Timestamp:
- Apr 11, 2011 11:31:19 AM (13 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r83454 r83460 1 2011-04-11 Brian Weinstein <bweinstein@apple.com> 2 3 Reviewed by Adam Roben. 4 5 WebKit2: Windows 7 Gestures Window Bounce shouldn't require a sync message 6 https://bugs.webkit.org/show_bug.cgi?id=58167 7 <rdar://problem/9259813> 8 9 Instead of making GestureDidScroll sync, have WebPageWin call from WebProcess -> 10 UIProcess when the gesture causes the page to scroll to the beginning or the 11 end of the document. 12 13 * UIProcess/PageClient.h: 14 * UIProcess/WebPageProxy.cpp: 15 (WebKit::WebPageProxy::gestureDidScroll): Not a sync message anymore. 16 (WebKit::WebPageProxy::setGestureScrollingLimitReached): Tell the page client that the gesture 17 scrolling limnit was reached. 18 * UIProcess/WebPageProxy.h: 19 * UIProcess/WebPageProxy.messages.in: Add a new message. 20 * UIProcess/win/WebView.cpp: 21 (WebKit::WebView::WebView): Initialize new variable. 22 (WebKit::WebView::onGesture): Use the state of the member variable, not the response from 23 the sync message. 24 * UIProcess/win/WebView.h: 25 (WebKit::WebView::setGestureScrollingLimitReached): 26 * WebProcess/WebPage/WebPage.h: 27 * WebProcess/WebPage/WebPage.messages.in: 28 * WebProcess/WebPage/win/WebPageWin.cpp: 29 (WebKit::scrollbarAtTopOfBottomOrDocument): Returns whether or not the scrollbar is at the 30 top or bottom of the document. 31 (WebKit::WebPage::gestureDidScroll): Track whether or not we started at the beginning 32 or end of the document, and whether or not we ended at the beginning or end of the document, 33 and send a message if the value changed. 34 1 35 2011-04-04 Jer Noble <jer.noble@apple.com> 2 36 -
trunk/Source/WebKit2/UIProcess/PageClient.h
r83454 r83460 131 131 #if PLATFORM(WIN) 132 132 virtual HWND nativeWindow() = 0; 133 virtual void setGestureReachedScrollingLimit(bool) = 0; 133 134 #endif 134 135 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r83454 r83460 676 676 } 677 677 678 bool WebPageProxy::gestureDidScroll(const IntSize& size) 679 { 680 bool atBeginningOrEndOfScrollableDocument = false; 681 process()->sendSync(Messages::WebPage::GestureDidScroll(size), Messages::WebPage::GestureDidScroll::Reply(atBeginningOrEndOfScrollableDocument), m_pageID); 682 return atBeginningOrEndOfScrollableDocument; 678 void WebPageProxy::gestureDidScroll(const IntSize& size) 679 { 680 process()->send(Messages::WebPage::GestureDidScroll(size), m_pageID); 683 681 } 684 682 … … 686 684 { 687 685 process()->send(Messages::WebPage::GestureDidEnd(), m_pageID); 686 } 687 688 void WebPageProxy::setGestureReachedScrollingLimit(bool limitReached) 689 { 690 m_pageClient->setGestureReachedScrollingLimit(limitReached); 688 691 } 689 692 #endif -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r83454 r83460 277 277 278 278 bool gestureWillBegin(const WebCore::IntPoint&); 279 boolgestureDidScroll(const WebCore::IntSize&);279 void gestureDidScroll(const WebCore::IntSize&); 280 280 void gestureDidEnd(); 281 282 void setGestureReachedScrollingLimit(bool); 281 283 #endif 282 284 #if ENABLE(TILED_BACKING_STORE) -
trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in
r83369 r83460 234 234 RecordAutocorrectionResponse(int32_t responseType, String replacedString, String replacementString); 235 235 #endif 236 237 #if PLATFORM(WIN) 238 # Windows 7 Gesture Messages 239 SetGestureReachedScrollingLimit(bool limitReached) 240 #endif 236 241 } -
trunk/Source/WebKit2/UIProcess/win/WebView.cpp
r83454 r83460 276 276 , m_lastPanY(0) 277 277 , m_overPanY(0) 278 , m_gestureReachedScrollingLimit(false) 278 279 { 279 280 registerWebViewWindowClass(); … … 570 571 m_overPanY -= deltaY; 571 572 572 bool shouldBounceWindow = m_page->gestureDidScroll(IntSize(deltaX, deltaY)); 573 if (deltaX || deltaY) 574 m_page->gestureDidScroll(IntSize(deltaX, deltaY)); 573 575 574 576 if (gi.dwFlags & GF_BEGIN) { 575 577 BeginPanningFeedbackPtr()(m_window); 578 m_gestureReachedScrollingLimit = false; 576 579 m_overPanY = 0; 577 580 } else if (gi.dwFlags & GF_END) { … … 583 586 // FIXME: Window Bounce doesn't undo until user releases their finger - <http://webkit.org/b/58069>. 584 587 585 if ( shouldBounceWindow)588 if (m_gestureReachedScrollingLimit) 586 589 UpdatePanningFeedbackPtr()(m_window, 0, m_overPanY, gi.dwFlags & GF_INERTIA); 587 590 -
trunk/Source/WebKit2/UIProcess/win/WebView.h
r83454 r83460 192 192 virtual HWND nativeWindow(); 193 193 194 virtual void setGestureReachedScrollingLimit(bool limitReached) { m_gestureReachedScrollingLimit = limitReached; } 195 194 196 // WebCore::WindowMessageListener 195 197 virtual void windowReceivedMessage(HWND, UINT message, WPARAM, LPARAM); … … 232 234 233 235 int m_overPanY; 236 237 bool m_gestureReachedScrollingLimit; 234 238 }; 235 239 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r83368 r83460 170 170 , m_cachedMainFrameIsPinnedToLeftSide(false) 171 171 , m_cachedMainFrameIsPinnedToRightSide(false) 172 #if PLATFORM(WIN) 173 , m_gestureReachedScrollingLimit(false) 174 #endif 172 175 { 173 176 ASSERT(m_pageID); -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r83372 r83460 332 332 333 333 void gestureWillBegin(const WebCore::IntPoint&, bool& canBeginPanning); 334 void gestureDidScroll(const WebCore::IntSize& , bool& atBeginningOrEndOfDocument);334 void gestureDidScroll(const WebCore::IntSize&); 335 335 void gestureDidEnd(); 336 336 #endif … … 633 633 bool m_cachedMainFrameIsPinnedToLeftSide; 634 634 bool m_cachedMainFrameIsPinnedToRightSide; 635 636 #if PLATFORM(WIN) 637 bool m_gestureReachedScrollingLimit; 638 #endif 635 639 }; 636 640 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
r83362 r83460 205 205 206 206 GestureWillBegin(WebCore::IntPoint point) -> (bool canBeginPanning) 207 GestureDidScroll(WebCore::IntSize size) -> (bool atBeginningOrEndOfScrollableDocument)207 GestureDidScroll(WebCore::IntSize size) 208 208 GestureDidEnd() 209 209 #endif -
trunk/Source/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp
r83197 r83460 29 29 #include "FontSmoothingLevel.h" 30 30 #include "WebEvent.h" 31 #include "WebPageProxyMessages.h" 31 32 #include "WebPreferencesStore.h" 32 33 #include <WebCore/FocusController.h> … … 358 359 void WebPage::gestureWillBegin(const WebCore::IntPoint& point, bool& canBeginPanning) 359 360 { 361 m_gestureReachedScrollingLimit = false; 362 360 363 bool hitScrollbar = false; 361 364 … … 402 405 } 403 406 404 void WebPage::gestureDidScroll(const IntSize& size, bool& atBeginningOrEndOfScrollableDocument) 405 { 406 atBeginningOrEndOfScrollableDocument = false; 407 static bool scrollbarAtTopOrBottomOfDocument(Scrollbar* scrollbar) 408 { 409 ASSERT_ARG(scrollbar, scrollbar); 410 return !scrollbar->currentPos() || scrollbar->currentPos() >= scrollbar->maximum(); 411 } 412 413 void WebPage::gestureDidScroll(const IntSize& size) 414 { 415 ASSERT_ARG(size, !size.isZero()); 407 416 408 417 if (!m_gestureTargetNode || !m_gestureTargetNode->renderer() || !m_gestureTargetNode->renderer()->enclosingLayer()) 409 418 return; 410 419 420 Scrollbar* verticalScrollbar = 0; 421 if (Frame* frame = m_page->mainFrame()) { 422 if (ScrollView* view = frame->view()) 423 verticalScrollbar = view->verticalScrollbar(); 424 } 425 411 426 m_gestureTargetNode->renderer()->enclosingLayer()->scrollByRecursively(size.width(), size.height()); 412 413 Frame* frame = m_page->mainFrame(); 414 if (!frame) 415 return; 416 417 ScrollView* view = frame->view(); 418 if (!view) 419 return; 420 421 Scrollbar* verticalScrollbar = view->verticalScrollbar(); 422 if (!verticalScrollbar) 423 return; 424 425 atBeginningOrEndOfScrollableDocument = !verticalScrollbar->currentPos() || verticalScrollbar->currentPos() >= verticalScrollbar->maximum(); 427 bool gestureReachedScrollingLimit = verticalScrollbar && scrollbarAtTopOrBottomOfDocument(verticalScrollbar); 428 429 // FIXME: We really only want to update this state if the state was updated via scrolling the main frame, 430 // not scrolling something in a main frame when the main frame had already reached its scrolling limit. 431 432 if (gestureReachedScrollingLimit == m_gestureReachedScrollingLimit) 433 return; 434 435 send(Messages::WebPageProxy::SetGestureReachedScrollingLimit(gestureReachedScrollingLimit)); 436 m_gestureReachedScrollingLimit = gestureReachedScrollingLimit; 426 437 } 427 438
Note: See TracChangeset
for help on using the changeset viewer.