2011-04-02 Sam Weinig <sam@webkit.org>
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 2 Apr 2011 20:30:01 +0000 (20:30 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 2 Apr 2011 20:30:01 +0000 (20:30 +0000)
        Reviewed by Dan Bernstein.

        Implement WKBundleFrameHasHorizontalScrollbar/WKBundleFrameHasVerticalScrollbar
        <rdar://problem/9225772>
        https://bugs.webkit.org/show_bug.cgi?id=57709

        * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
        (WKBundleFrameHasHorizontalScrollbar):
        (WKBundleFrameHasVerticalScrollbar):
        * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::hasHorizontalScrollbar):
        (WebKit::WebFrame::hasVerticalScrollbar):
        * WebProcess/WebPage/WebFrame.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@82773 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.h
Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
Source/WebKit2/WebProcess/WebPage/WebFrame.h

index c5cb283..201303f 100644 (file)
@@ -1,3 +1,20 @@
+2011-04-02  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Dan Bernstein.
+
+        Implement WKBundleFrameHasHorizontalScrollbar/WKBundleFrameHasVerticalScrollbar
+        <rdar://problem/9225772>
+        https://bugs.webkit.org/show_bug.cgi?id=57709
+
+        * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
+        (WKBundleFrameHasHorizontalScrollbar):
+        (WKBundleFrameHasVerticalScrollbar):
+        * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
+        * WebProcess/WebPage/WebFrame.cpp:
+        (WebKit::WebFrame::hasHorizontalScrollbar):
+        (WebKit::WebFrame::hasVerticalScrollbar):
+        * WebProcess/WebPage/WebFrame.h:
+
 2011-04-01  Jon Lee  <jonlee@apple.com>
 
         Reviewed by Darin Adler.
index dd44e93..5528dfe 100644 (file)
@@ -201,6 +201,16 @@ WKSize WKBundleFrameGetScrollOffset(WKBundleFrameRef frameRef)
     return toAPI(toImpl(frameRef)->scrollOffset());
 }
 
+bool WKBundleFrameHasHorizontalScrollbar(WKBundleFrameRef frameRef)
+{
+    return toImpl(frameRef)->hasHorizontalScrollbar();
+}
+
+bool WKBundleFrameHasVerticalScrollbar(WKBundleFrameRef frameRef)
+{
+    return toImpl(frameRef)->hasVerticalScrollbar();
+}
+
 bool WKBundleFrameGetDocumentBackgroundColor(WKBundleFrameRef frameRef, double* red, double* green, double* blue, double* alpha)
 {
     return toImpl(frameRef)->getDocumentBackgroundColor(red, green, blue, alpha);
index 3c7c52d..727ea53 100644 (file)
@@ -63,6 +63,9 @@ WK_EXPORT WKRect WKBundleFrameGetVisibleContentBounds(WKBundleFrameRef frame);
 WK_EXPORT WKRect WKBundleFrameGetVisibleContentBoundsExcludingScrollbars(WKBundleFrameRef frame);
 WK_EXPORT WKSize WKBundleFrameGetScrollOffset(WKBundleFrameRef frame);
 
+WK_EXPORT bool WKBundleFrameHasHorizontalScrollbar(WKBundleFrameRef frame);
+WK_EXPORT bool WKBundleFrameHasVerticalScrollbar(WKBundleFrameRef frame);
+
 WK_EXPORT bool WKBundleFrameGetDocumentBackgroundColor(WKBundleFrameRef frame, double* red, double* green, double* blue, double* alpha);
 
 WK_EXPORT WKStringRef WKBundleFrameCopySuggestedFilenameForResourceWithURL(WKBundleFrameRef frame, WKURLRef url);
index 574634f..1aaafd0 100644 (file)
@@ -512,6 +512,30 @@ IntSize WebFrame::scrollOffset() const
     return view->scrollOffset();
 }
 
+bool WebFrame::hasHorizontalScrollbar() const
+{
+    if (!m_coreFrame)
+        return false;
+
+    FrameView* view = m_coreFrame->view();
+    if (!view)
+        return false;
+
+    return view->horizontalScrollbar();
+}
+
+bool WebFrame::hasVerticalScrollbar() const
+{
+    if (!m_coreFrame)
+        return false;
+
+    FrameView* view = m_coreFrame->view();
+    if (!view)
+        return false;
+
+    return view->verticalScrollbar();
+}
+
 bool WebFrame::getDocumentBackgroundColor(double* red, double* green, double* blue, double* alpha)
 {
     if (!m_coreFrame)
index 3c63cf3..b6e1e13 100644 (file)
@@ -93,6 +93,8 @@ public:
     WebCore::IntRect visibleContentBounds() const;
     WebCore::IntRect visibleContentBoundsExcludingScrollbars() const;
     WebCore::IntSize scrollOffset() const;
+    bool hasHorizontalScrollbar() const;
+    bool hasVerticalScrollbar() const;
     bool getDocumentBackgroundColor(double* red, double* green, double* blue, double* alpha);
 
     static WebFrame* frameForContext(JSContextRef);