<rdar://problem/
8940648>
Reviewed by Anders Carlsson.
Source/WebCore:
* WebCore.exp.in:
Add additional exprots.
* page/ChromeClient.h:
(WebCore::ChromeClient::didCompleteRubberBandForMainFrame):
* page/FrameView.cpp:
(WebCore::FrameView::didCompleteRubberBand):
* page/FrameView.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::didCompleteRubberBand):
* platform/ScrollView.h:
Add hook.
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::inLiveResize):
(WebCore::ScrollableArea::maximumScrollPosition):
(WebCore::ScrollableArea::visibleWidth):
(WebCore::ScrollableArea::overhangAmount):
(WebCore::ScrollableArea::didCompleteRubberBand):
Reorganize and de-virtualize live resize notifications.
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::snapRubberBandTimerFired):
Call the new hook when the rubberband ends.
Source/WebKit2:
* UIProcess/API/C/WKPage.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::drawHeader):
(WebKit::WebPageProxy::drawFooter):
(WebKit::WebPageProxy::didCompleteRubberBandForMainFrame):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebUIClient.cpp:
(WebKit::WebUIClient::didCompleteRubberBandForMainFrame):
* UIProcess/WebUIClient.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::didCompleteRubberBandForMainFrame):
* WebProcess/WebCoreSupport/WebChromeClient.h:
Pipe the notification up to the WKUIClient.
Tools:
* MiniBrowser/mac/BrowserWindowController.m:
(-[BrowserWindowController awakeFromNib]):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::createOtherPage):
(WTR::TestController::initialize):
Stub out the new WKUIClient function.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@77509
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-02-02 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Add notification of the end of a rubber band.
+ <rdar://problem/8940648>
+
+ * WebCore.exp.in:
+ Add additional exprots.
+
+ * page/ChromeClient.h:
+ (WebCore::ChromeClient::didCompleteRubberBandForMainFrame):
+ * page/FrameView.cpp:
+ (WebCore::FrameView::didCompleteRubberBand):
+ * page/FrameView.h:
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::didCompleteRubberBand):
+ * platform/ScrollView.h:
+ Add hook.
+
+ * platform/ScrollableArea.h:
+ (WebCore::ScrollableArea::inLiveResize):
+ (WebCore::ScrollableArea::maximumScrollPosition):
+ (WebCore::ScrollableArea::visibleWidth):
+ (WebCore::ScrollableArea::overhangAmount):
+ (WebCore::ScrollableArea::didCompleteRubberBand):
+ Reorganize and de-virtualize live resize notifications.
+
+ * platform/mac/ScrollAnimatorMac.mm:
+ (WebCore::ScrollAnimatorMac::snapRubberBandTimerFired):
+ Call the new hook when the rubberband ends.
+
2011-02-02 Evan Martin <evan@chromium.org>
Reviewed by Tony Chang.
__ZN7WebCore14SchemeRegistry24registerURLSchemeAsLocalERKN3WTF6StringE
__ZN7WebCore14SchemeRegistry25registerURLSchemeAsSecureERKN3WTF6StringE
__ZN7WebCore14SchemeRegistry32registerURLSchemeAsEmptyDocumentERKN3WTF6StringE
+__ZN7WebCore14ScrollableArea17willEndLiveResizeEv
+__ZN7WebCore14ScrollableArea19willStartLiveResizeEv
__ZN7WebCore14SecurityOrigin14threadsafeCopyEv
__ZN7WebCore14SecurityOrigin16createFromStringERKN3WTF6StringE
__ZN7WebCore14SecurityOrigin18setLocalLoadPolicyENS0_15LocalLoadPolicyE
virtual void postAccessibilityNotification(AccessibilityObject*, AXObjectCache::AXNotification) { }
+ virtual void didCompleteRubberBandForMainFrame(const IntSize&) const { }
+
protected:
virtual ~ChromeClient() { }
};
return page->chrome()->windowResizerRect();
}
+void FrameView::didCompleteRubberBand(const IntSize& initialOverhang) const
+{
+ Page* page = m_frame->page();
+ if (page->mainFrame() != m_frame)
+ return;
+ return page->chrome()->client()->didCompleteRubberBandForMainFrame(initialOverhang);
+}
+
#if ENABLE(DASHBOARD_SUPPORT)
void FrameView::updateDashboardRegions()
{
virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&);
virtual bool isActive() const;
virtual void getTickmarks(Vector<IntRect>&) const;
-
virtual void scrollTo(const IntSize&);
+ virtual void didCompleteRubberBand(const IntSize&) const;
void deferredRepaintTimerFired(Timer<FrameView>*);
void doDeferredRepaints();
return scrollbar ? (scrollbar->totalSize() - scrollbar->visibleSize()) : 0;
}
+void ScrollView::didCompleteRubberBand(const IntSize&) const
+{
+}
+
void ScrollView::setScrollOffset(const IntPoint& offset)
{
int horizontalOffset = offset.x();
virtual int scrollSize(ScrollbarOrientation orientation) const;
virtual int scrollPosition(Scrollbar*) const;
virtual void setScrollOffset(const IntPoint&);
-
+ virtual void didCompleteRubberBand(const IntSize&) const;
+
// NOTE: This should only be called by the overriden setScrollOffset from ScrollableArea.
virtual void scrollTo(const IntSize& newOffset);
bool constrainsScrollingToContentEdge() const { return m_constrainsScrollingToContentEdge; }
void setConstrainsScrollingToContentEdge(bool constrainsScrollingToContentEdge) { m_constrainsScrollingToContentEdge = constrainsScrollingToContentEdge; }
+ bool inLiveResize() const { return m_inLiveResize; }
+ void willStartLiveResize();
+ void willEndLiveResize();
+
ScrollAnimator* scrollAnimator() const { return m_scrollAnimator.get(); }
-
+
virtual int scrollSize(ScrollbarOrientation) const = 0;
virtual int scrollPosition(Scrollbar*) const = 0;
virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) = 0;
virtual IntPoint scrollPosition() const { ASSERT_NOT_REACHED(); return IntPoint(); }
virtual IntPoint minimumScrollPosition() const { ASSERT_NOT_REACHED(); return IntPoint(); }
virtual IntPoint maximumScrollPosition() const { ASSERT_NOT_REACHED(); return IntPoint(); }
-
virtual IntRect visibleContentRect(bool = false) const { ASSERT_NOT_REACHED(); return IntRect(); }
virtual int visibleHeight() const { ASSERT_NOT_REACHED(); return 0; }
virtual int visibleWidth() const { ASSERT_NOT_REACHED(); return 0; }
-
virtual IntSize contentsSize() const { ASSERT_NOT_REACHED(); return IntSize(); }
virtual IntSize overhangAmount() const { ASSERT_NOT_REACHED(); return IntSize(); }
-
virtual IntPoint currentMousePosition() const { return IntPoint(); }
-
- virtual bool inLiveResize() const { return m_inLiveResize; }
- virtual void willStartLiveResize();
- virtual void willEndLiveResize();
+ virtual void didCompleteRubberBand(const IntSize&) const { ASSERT_NOT_REACHED(); }
private:
// NOTE: Only called from the ScrollAnimator.
} else {
immediateScrollToPoint(m_origOrigin);
+ m_scrollableArea->didCompleteRubberBand(roundedIntSize(m_startStretch));
+
m_snapRubberBandTimer.stop();
m_stretchScrollForce = FloatSize();
+2011-02-02 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Add notification of the end of a rubber band.
+ <rdar://problem/8940648>
+
+ * UIProcess/API/C/WKPage.h:
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::drawHeader):
+ (WebKit::WebPageProxy::drawFooter):
+ (WebKit::WebPageProxy::didCompleteRubberBandForMainFrame):
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/WebPageProxy.messages.in:
+ * UIProcess/WebUIClient.cpp:
+ (WebKit::WebUIClient::didCompleteRubberBandForMainFrame):
+ * UIProcess/WebUIClient.h:
+ * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+ (WebKit::WebChromeClient::didCompleteRubberBandForMainFrame):
+ * WebProcess/WebCoreSupport/WebChromeClient.h:
+ Pipe the notification up to the WKUIClient.
+
2011-02-03 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r77449.
typedef void (*WKPageDrawHeaderCallback)(WKPageRef page, WKFrameRef frame, WKRect rect, const void* clientInfo);
typedef void (*WKPageDrawFooterCallback)(WKPageRef page, WKFrameRef frame, WKRect rect, const void* clientInfo);
typedef void (*WKPagePrintFrameCallback)(WKPageRef page, WKFrameRef frame, const void* clientInfo);
+typedef void (*WKPageDidCompleteRubberBandForMainFrameCallback)(WKPageRef page, WKSize initialOverhang, const void* clientInfo);
struct WKPageUIClient {
int version;
WKPageDrawFooterCallback drawFooter;
WKPagePrintFrameCallback printFrame;
WKPageCallback runModal;
+ WKPageDidCompleteRubberBandForMainFrameCallback didCompleteRubberBandForMainFrame;
};
typedef struct WKPageUIClient WKPageUIClient;
return m_uiClient.footerHeight(this, frame);
}
-void WebPageProxy::drawHeader(WebFrameProxy* frame, const WebCore::FloatRect& rect)
+void WebPageProxy::drawHeader(WebFrameProxy* frame, const FloatRect& rect)
{
m_uiClient.drawHeader(this, frame, rect);
}
-void WebPageProxy::drawFooter(WebFrameProxy* frame, const WebCore::FloatRect& rect)
+void WebPageProxy::drawFooter(WebFrameProxy* frame, const FloatRect& rect)
{
m_uiClient.drawFooter(this, frame, rect);
}
+void WebPageProxy::didCompleteRubberBandForMainFrame(const IntSize& initialOverhang)
+{
+ m_uiClient.didCompleteRubberBandForMainFrame(this, initialOverhang);
+}
+
void WebPageProxy::didFinishLoadingDataForCustomRepresentation(const CoreIPC::DataReference& dataReference)
{
m_pageClient->didFinishLoadingDataForCustomRepresentation(dataReference);
void exceededDatabaseQuota(uint64_t frameID, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentUsage, uint64_t expectedUsage, uint64_t& newQuota);
void requestGeolocationPermissionForFrame(uint64_t geolocationID, uint64_t frameID, String originIdentifier);
void runModal() { m_uiClient.runModal(this); }
+ void didCompleteRubberBandForMainFrame(const WebCore::IntSize&);
void reattachToWebProcess();
void reattachToWebProcessWithItem(WebBackForwardListItem*);
RunOpenPanel(uint64_t frameID, WebKit::WebOpenPanelParameters::Data parameters)
PrintFrame(uint64_t frameID) -> ()
RunModal()
+ DidCompleteRubberBandForMainFrame(WebCore::IntSize initialOverhang)
#if ENABLE(TILED_BACKING_STORE)
PageDidRequestScroll(WebCore::IntSize delta)
m_client.runModal(toAPI(page), m_client.clientInfo);
}
+void WebUIClient::didCompleteRubberBandForMainFrame(WebPageProxy* page, const IntSize& initialOverhang)
+{
+ if (!m_client.runModal)
+ return;
+
+ m_client.didCompleteRubberBandForMainFrame(toAPI(page), toAPI(initialOverhang), m_client.clientInfo);
+}
+
} // namespace WebKit
bool canRunModal() const;
void runModal(WebPageProxy*);
+
+ void didCompleteRubberBandForMainFrame(WebPageProxy*, const WebCore::IntSize&);
};
} // namespace WebKit
m_page->send(Messages::WebPageProxy::DidChangeViewportData(args));
}
+void WebChromeClient::didCompleteRubberBandForMainFrame(const IntSize& initialOverhang) const
+{
+ m_page->send(Messages::WebPageProxy::DidCompleteRubberBandForMainFrame(initialOverhang));
+}
+
} // namespace WebKit
virtual void dispatchViewportDataDidChange(const WebCore::ViewportArguments&) const;
+ virtual void didCompleteRubberBandForMainFrame(const WebCore::IntSize&) const;
+
String m_cachedToolTip;
mutable RefPtr<WebFrame> m_cachedFrameSetLargestFrame;
WebPage* m_page;
+2011-02-02 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Add notification of the end of a rubber band.
+ <rdar://problem/8940648>
+
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController awakeFromNib]):
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::createOtherPage):
+ (WTR::TestController::initialize):
+ Stub out the new WKUIClient function.
+
2011-02-03 Gabor Rapcsanyi <rgabor@webkit.org>
Unreviewed.
0, // drawFooter
0, // printFrame
0, // showModal
+ 0, // didCompleteRubberBandForMainFrame
};
WKPageSetPageUIClient(_webView.pageRef, &uiClient);
}
0, // drawFooter
0, // printFrame
runModal,
+ 0, // didCompleteRubberBandForMainFrame
};
WKPageSetPageUIClient(newPage, &otherPageUIClient);
0, // drawFooter
0, // printFrame
0, // runModal
+ 0, // didCompleteRubberBandForMainFrame
};
WKPageSetPageUIClient(m_mainWebView->page(), &pageUIClient);