Changeset 101290 in webkit
- Timestamp:
- Nov 28, 2011 3:06:56 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r101288 r101290 1 2011-11-28 Beth Dakin <bdakin@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=72551 4 When the recommended scrollbar style changes, WKView's tracking options should 5 adjust accordingly 6 -and corresponding- 7 <rdar://problem/10409328> 8 9 Reviewed by Darin Adler. 10 11 This new ChromeClient function is called when the recommended scrollbar style 12 changes. This way, WebKit can respond to the change by adjusting its mouse 13 tracking. 14 * page/ChromeClient.h: 15 (WebCore::ChromeClient::recommendedScrollbarStyleDidChange): 16 17 Existing ScrollableArea function scrollbarStyleChanged() now takes an int 18 indicating the new scrollbar style and a bool indicating whether it is necessary 19 to force an update. It used to be the case that this function was ONLY used to 20 force an update (and only called when an updated was needed), but now that it must 21 also call into the ChromeClient, it is necessary to include a bool tracking 22 whether we need to force an update. New implementation on FrameView is responsible 23 for calling ChromeClient, and then that calls into the pre-existing ScrollView 24 function for the forceUpdate part. 25 * page/FrameView.cpp: 26 (WebCore::FrameView::scrollbarStyleChanged): 27 * page/FrameView.h: 28 * platform/ScrollView.cpp: 29 (WebCore::ScrollView:: scrollbarStyleChanged): 30 * platform/ScrollView.h: 31 * platform/ScrollableArea.h: 32 (WebCore::ScrollableArea::scrollbarStyleChanged): 33 * platform/mac/ScrollAnimatorMac.mm: 34 (WebCore::ScrollAnimatorMac::updateScrollerStyle): 35 1 36 2011-11-28 Julien Chaffraix <jchaffraix@webkit.org> 2 37 -
trunk/Source/WebCore/page/ChromeClient.h
r100842 r101290 326 326 327 327 virtual void notifyScrollerThumbIsVisibleInRect(const IntRect&) { } 328 virtual void recommendedScrollbarStyleDidChange(int /*newStyle*/) { } 328 329 329 330 enum DialogType { -
trunk/Source/WebCore/page/FrameView.cpp
r100842 r101290 2449 2449 } 2450 2450 2451 void FrameView::scrollbarStyleChanged(int newStyle, bool forceUpdate) 2452 { 2453 Page* page = m_frame->page(); 2454 if (!page) 2455 return; 2456 if (page->mainFrame() != m_frame) 2457 return; 2458 page->chrome()->client()->recommendedScrollbarStyleDidChange(newStyle); 2459 2460 if (forceUpdate) 2461 ScrollView::scrollbarStyleChanged(newStyle, forceUpdate); 2462 } 2463 2451 2464 void FrameView::setAnimatorsAreActive() 2452 2465 { -
trunk/Source/WebCore/page/FrameView.h
r100842 r101290 293 293 294 294 virtual bool shouldSuspendScrollAnimations() const; 295 virtual void scrollbarStyleChanged(int newStyle, bool forceUpdate); 295 296 296 297 void setAnimatorsAreActive(); -
trunk/Source/WebCore/platform/ScrollView.cpp
r100842 r101290 974 974 } 975 975 976 void ScrollView::scrollbarStyleChanged() 977 { 976 void ScrollView::scrollbarStyleChanged(int, bool forceUpdate) 977 { 978 if (!forceUpdate) 979 return; 980 978 981 contentsResized(); 979 982 updateScrollbars(scrollOffset()); -
trunk/Source/WebCore/platform/ScrollView.h
r100842 r101290 60 60 virtual void notifyPageThatContentAreaWillPaint() const; 61 61 virtual bool isScrollCornerVisible() const; 62 virtual void scrollbarStyleChanged( );62 virtual void scrollbarStyleChanged(int newStyle, bool forceUpdate); 63 63 64 64 // NOTE: This should only be called by the overriden setScrollOffset from ScrollableArea. -
trunk/Source/WebCore/platform/ScrollableArea.h
r100842 r101290 140 140 141 141 virtual bool shouldSuspendScrollAnimations() const { return true; } 142 virtual void scrollbarStyleChanged( ) { }142 virtual void scrollbarStyleChanged(int /*newStyle*/, bool /*forceUpdate*/) { } 143 143 virtual void setVisibleScrollerThumbRect(const IntRect&) { } 144 144 -
trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm
r100842 r101290 1462 1462 // If needsScrollerStyleUpdate() is true, then the page is restoring from the page cache, and 1463 1463 // a relayout will happen on its own. Otherwise, we must initiate a re-layout ourselves. 1464 if (!needsScrollerStyleUpdate()) 1465 scrollableArea()->scrollbarStyleChanged(); 1464 scrollableArea()->scrollbarStyleChanged(newStyle, !needsScrollerStyleUpdate()); 1466 1465 1467 1466 setNeedsScrollerStyleUpdate(false); -
trunk/Source/WebKit2/ChangeLog
r101269 r101290 1 2011-11-28 Beth Dakin <bdakin@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=72551 4 When the recommended scrollbar style changes, WKView's tracking options should 5 adjust accordingly 6 -and corresponding- 7 <rdar://problem/10409328> 8 9 Reviewed by Darin Adler. 10 11 These new functions take care of passing along the 12 recommendedScrollbarStyleDidChange() message that originates in the ChromeClient. 13 * UIProcess/API/mac/PageClientImpl.h: 14 * UIProcess/PageClient.h: 15 * UIProcess/WebPageProxy.cpp: 16 (WebKit::WebPageProxy::recommendedScrollbarStyleDidChange): 17 * UIProcess/WebPageProxy.h: 18 * UIProcess/WebPageProxy.messages.in: 19 * WebProcess/WebCoreSupport/WebChromeClient.cpp: 20 (WebKit::WebChromeClient::recommendedScrollbarStyleDidChange): 21 * WebProcess/WebCoreSupport/WebChromeClient.h: 22 23 This is where we actually respond to the recommendedScrollbarStyleDidChange 24 message. We remove the existing tracking area and create a new tracking area with 25 the appropriate tracking options. 26 * UIProcess/API/mac/PageClientImpl.mm: 27 (WebKit::PageClientImpl::recommendedScrollbarStyleDidChange): 28 29 BuiltInPDFView inherits from WebCore::ScrollableArea, so scrollbarStyleChanged() 30 must now take two parameters like the one in ScrollableArea. 31 * WebProcess/Plugins/PDF/BuiltInPDFView.cpp: 32 (WebKit::BuiltInPDFView::scrollbarStyleChanged): 33 * WebProcess/Plugins/PDF/BuiltInPDFView.h: 34 1 35 2011-11-28 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org> 2 36 -
trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h
r100842 r101290 123 123 virtual void recordAutocorrectionResponse(WebCore::EditorClient::AutocorrectionResponseType, const String& replacedString, const String& replacementString); 124 124 125 virtual void recommendedScrollbarStyleDidChange(int32_t newStyle); 126 125 127 virtual WKView* wkView() const { return m_wkView; } 126 128 -
trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm
r100842 r101290 461 461 } 462 462 463 void PageClientImpl::recommendedScrollbarStyleDidChange(int32_t newStyle) 464 { 465 #if !defined(BUILDING_ON_SNOW_LEOPARD) 466 NSArray *trackingAreas = [m_wkView trackingAreas]; 467 NSUInteger count = [trackingAreas count]; 468 ASSERT(count == 1); 469 470 for (NSUInteger i = 0; i < count; ++i) 471 [m_wkView removeTrackingArea:[trackingAreas objectAtIndex:i]]; 472 473 // Now re-create a tracking area with the appropriate options given the new scrollbar style 474 NSTrackingAreaOptions options = NSTrackingMouseMoved | NSTrackingMouseEnteredAndExited | NSTrackingInVisibleRect; 475 if (newStyle == NSScrollerStyleLegacy) 476 options |= NSTrackingActiveAlways; 477 else 478 options |= NSTrackingActiveInKeyWindow; 479 480 NSTrackingArea *trackingArea = [[NSTrackingArea alloc] initWithRect:[m_wkView frame] 481 options:options 482 owner:m_wkView 483 userInfo:nil]; 484 [m_wkView addTrackingArea:trackingArea]; 485 [trackingArea release]; 486 #else 487 UNUSED_PARAM(newStyle); 488 #endif 489 } 490 463 491 bool PageClientImpl::executeSavedCommandBySelector(const String& selectorString) 464 492 { -
trunk/Source/WebKit2/UIProcess/PageClient.h
r100842 r101290 178 178 virtual String dismissCorrectionPanelSoon(WebCore::ReasonForDismissingCorrectionPanel) = 0; 179 179 virtual void recordAutocorrectionResponse(WebCore::EditorClient::AutocorrectionResponseType, const String& replacedString, const String& replacementString) = 0; 180 virtual void recommendedScrollbarStyleDidChange(int32_t newStyle) = 0; 180 181 181 182 virtual WKView* wkView() const = 0; -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r101259 r101290 3303 3303 } 3304 3304 3305 void WebPageProxy::recommendedScrollbarStyleDidChange(int32_t newStyle) 3306 { 3307 #if PLATFORM(MAC) 3308 m_pageClient->recommendedScrollbarStyleDidChange(newStyle); 3309 #endif 3310 } 3311 3305 3312 void WebPageProxy::didChangeScrollbarsForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar) 3306 3313 { -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r100842 r101290 671 671 void runModal(); 672 672 void notifyScrollerThumbIsVisibleInRect(const WebCore::IntRect&); 673 void recommendedScrollbarStyleDidChange(int32_t newStyle); 673 674 void didChangeScrollbarsForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar); 674 675 void didChangeScrollOffsetPinningForMainFrame(bool pinnedToLeftSide, bool pinnedToRightSide); -
trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in
r100842 r101290 62 62 RunModal() 63 63 NotifyScrollerThumbIsVisibleInRect(WebCore::IntRect scrollerThumb) 64 RecommendedScrollbarStyleDidChange(int32_t newStyle) 64 65 DidChangeScrollbarsForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar) 65 66 DidChangeScrollOffsetPinningForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar) -
trunk/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.cpp
r100842 r101290 673 673 } 674 674 675 void BuiltInPDFView::scrollbarStyleChanged() 676 { 675 void BuiltInPDFView::scrollbarStyleChanged(int, bool forceUpdate) 676 { 677 if (!forceUpdate) 678 return; 679 677 680 // If the PDF was scrolled all the way to bottom right and scrollbars change to overlay style, we don't want to display white rectangles where scrollbars were. 678 681 IntPoint newScrollOffset = IntPoint(m_scrollOffset).shrunkTo(maximumScrollPosition()); -
trunk/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.h
r100842 r101290 135 135 virtual void disconnectFromPage() { m_page = 0; } 136 136 virtual bool shouldSuspendScrollAnimations() const { return false; } // If we return true, ScrollAnimatorMac will keep cycling a timer forever, waiting for a good time to animate. 137 virtual void scrollbarStyleChanged( );137 virtual void scrollbarStyleChanged(int newStyle, bool forceUpdate); 138 138 virtual void zoomAnimatorTransformChanged(float, float, float, ZoomAnimationState) { } 139 139 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
r101167 r101290 781 781 } 782 782 783 void WebChromeClient::recommendedScrollbarStyleDidChange(int32_t newStyle) 784 { 785 m_page->send(Messages::WebPageProxy::RecommendedScrollbarStyleDidChange(newStyle)); 786 } 787 783 788 bool WebChromeClient::shouldRubberBandInDirection(WebCore::ScrollDirection direction) const 784 789 { -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
r100842 r101290 215 215 216 216 virtual void notifyScrollerThumbIsVisibleInRect(const WebCore::IntRect&) OVERRIDE; 217 virtual void recommendedScrollbarStyleDidChange(int32_t newStyle) OVERRIDE; 217 218 virtual bool shouldRubberBandInDirection(WebCore::ScrollDirection) const OVERRIDE; 218 219
Note: See TracChangeset
for help on using the changeset viewer.