+2011-02-02 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Beth Dakin.
+
+ Add ChromeClient function to paint custom overhang areas.
+ https://bugs.webkit.org/show_bug.cgi?id=53639
+
+ * page/Chrome.cpp:
+ (WebCore::ChromeClient::paintCustomOverhangArea):
+ * page/ChromeClient.h:
+ Add ChromeClient function.
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::paintOverhangAreas):
+ * page/FrameView.h:
+ Call out the the ChromeClient, call ScrollView base implementation
+ if the ChromeClient returns false.
+
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::paintOverhangAreas):
+ * platform/ScrollView.h:
+ Add dirty rect for use when painting overhang areas.
+
2011-02-02 Peter Kasting <pkasting@google.com>
Not reviewed, build fix.
return false;
}
+bool ChromeClient::paintCustomOverhangArea(GraphicsContext*, const IntRect&, const IntRect&, const IntRect&)
+{
+ return false;
+}
+
bool Chrome::selectItemWritingDirectionIsNatural()
{
return m_client->selectItemWritingDirectionIsNatural();
float value, float proportion, ScrollbarControlPartMask);
virtual bool paintCustomScrollCorner(GraphicsContext*, const FloatRect&);
+ virtual bool paintCustomOverhangArea(GraphicsContext*, const IntRect&, const IntRect&, const IntRect&);
+
// FIXME: Remove once all ports are using client-based geolocation. https://bugs.webkit.org/show_bug.cgi?id=40373
// For client-based geolocation, these two methods have moved to GeolocationClient. https://bugs.webkit.org/show_bug.cgi?id=50061
// This can be either a synchronous or asynchronous call. The ChromeClient can display UI asking the user for permission
m_nodeToDraw = node;
}
+void FrameView::paintOverhangAreas(GraphicsContext* context, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect)
+{
+ if (context->paintingDisabled())
+ return;
+
+ Page* page = m_frame->page();
+ if (page->mainFrame() == m_frame) {
+ if (page->chrome()->client()->paintCustomOverhangArea(context, horizontalOverhangArea, verticalOverhangArea, dirtyRect))
+ return;
+ }
+
+ return ScrollView::paintOverhangAreas(context, horizontalOverhangArea, verticalOverhangArea, dirtyRect);
+}
+
void FrameView::updateLayoutAndStyleIfNeededRecursive()
{
// We have to crawl our entire tree looking for any FrameViews that need
bool isPainting() const;
void setNodeToDraw(Node*);
+ virtual void paintOverhangAreas(GraphicsContext*, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect);
+
static double currentPaintTimeStamp() { return sCurrentPaintTimeStamp; } // returns 0 if not painting
void updateLayoutAndStyleIfNeededRecursive();
calculateOverhangAreasForPainting(horizontalOverhangRect, verticalOverhangRect);
if (!horizontalOverhangRect.isEmpty() || !verticalOverhangRect.isEmpty())
- paintOverhangAreas(context, horizontalOverhangRect, verticalOverhangRect);
+ paintOverhangAreas(context, horizontalOverhangRect, verticalOverhangRect, rect);
// Now paint the scrollbars.
if (!m_scrollbarsSuppressed && (m_horizontalScrollbar || m_verticalScrollbar)) {
}
}
-void ScrollView::paintOverhangAreas(GraphicsContext* context, const IntRect& horizontalOverhangRect, const IntRect& verticalOverhangRect)
+void ScrollView::paintOverhangAreas(GraphicsContext* context, const IntRect& horizontalOverhangRect, const IntRect& verticalOverhangRect, const IntRect&)
{
// FIXME: This should be checking the dirty rect.
virtual void repaintContentRectangle(const IntRect&, bool now = false);
virtual void paintContents(GraphicsContext*, const IntRect& damageRect) = 0;
+ void calculateOverhangAreasForPainting(IntRect& horizontalOverhangRect, IntRect& verticalOverhangRect);
+ virtual void paintOverhangAreas(GraphicsContext*, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect);
+
virtual void contentsResized() = 0;
virtual void visibleContentsResized() = 0;
// Called when the scroll position within this view changes. FrameView overrides this to generate repaint invalidations.
virtual void repaintFixedElementsAfterScrolling() {}
- void calculateOverhangAreasForPainting(IntRect& horizontalOverhangRect, IntRect& verticalOverhangRect);
- void paintOverhangAreas(GraphicsContext*, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea);
-
void platformInit();
void platformDestroy();
void platformAddChild(Widget*);
+2011-02-02 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Beth Dakin.
+
+ Add ChromeClient function to paint custom overhang areas.
+ https://bugs.webkit.org/show_bug.cgi?id=53639
+
+ * Shared/API/c/WKBase.h:
+ * Shared/API/c/WKGraphicsContext.cpp: Added.
+ (WKGraphicsContextGetTypeID):
+ * Shared/API/c/WKGraphicsContext.h: Added.
+ * Shared/API/c/WKSharedAPICast.h:
+ * Shared/API/c/cg/WKGraphicsContextCG.cpp: Added.
+ (WKGraphicsContextGetCGContext):
+ * Shared/API/c/cg/WKGraphicsContextCG.h: Added.
+ * Shared/APIObject.h:
+ * Shared/WebGraphicsContext.cpp: Added.
+ (WebKit::WebGraphicsContext::WebGraphicsContext):
+ * Shared/WebGraphicsContext.h: Added.
+ (WebKit::WebGraphicsContext::create):
+ (WebKit::WebGraphicsContext::platformContext):
+ (WebKit::WebGraphicsContext::type):
+ Add WebGraphicsContext API type.
+
+ * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
+ * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
+ (WebKit::InjectedBundlePageUIClient::pageDidScroll):
+ (WebKit::InjectedBundlePageUIClient::shouldPaintCustomOverhangArea):
+ (WebKit::InjectedBundlePageUIClient::paintCustomOverhangArea):
+ * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
+ * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+ (WebKit::WebChromeClient::paintCustomOverhangArea):
+ * WebProcess/WebCoreSupport/WebChromeClient.h:
+ Pipe paintCustomOverhangArea to the InjectedBundlePageUIClient.
+
+ * UIProcess/API/C/WebKit2.h:
+ * WebKit2.pro:
+ * WebKit2.xcodeproj/project.pbxproj:
+ * win/WebKit2.vcproj:
+ * win/WebKit2Generated.make:
+ Add new files.
+
2011-02-02 Anders Carlsson <andersca@apple.com>
Reviewed by Dan Bernstein.
typedef const struct OpaqueWKData* WKDataRef;
typedef const struct OpaqueWKDouble* WKDoubleRef;
typedef const struct OpaqueWKError* WKErrorRef;
+typedef const struct OpaqueWKGraphicsContext* WKGraphicsContextRef;
typedef const struct OpaqueWKImage* WKImageRef;
typedef const struct OpaqueWKSecurityOrigin* WKSecurityOriginRef;
typedef const struct OpaqueWKSerializedScriptValue* WKSerializedScriptValueRef;
--- /dev/null
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WKGraphicsContext.h"
+
+#include "WKSharedAPICast.h"
+#include "WebGraphicsContext.h"
+
+using namespace WebKit;
+
+WKTypeID WKGraphicsContextGetTypeID()
+{
+ return toAPI(WebGraphicsContext::APIType);
+}
--- /dev/null
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKGraphicsContext_h
+#define WKGraphicsContext_h
+
+#include <WebKit2/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKTypeID WKGraphicsContextGetTypeID();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKGraphicsContext_h */
class WebCertificateInfo;
class WebContextMenuItem;
class WebData;
+class WebGraphicsContext;
class WebImage;
class WebSecurityOrigin;
class WebSerializedScriptValue;
WK_ADD_API_MAPPING(WKDictionaryRef, ImmutableDictionary)
WK_ADD_API_MAPPING(WKDoubleRef, WebDouble)
WK_ADD_API_MAPPING(WKErrorRef, WebError)
+WK_ADD_API_MAPPING(WKGraphicsContextRef, WebGraphicsContext)
WK_ADD_API_MAPPING(WKImageRef, WebImage)
WK_ADD_API_MAPPING(WKMutableArrayRef, MutableArray)
WK_ADD_API_MAPPING(WKMutableDictionaryRef, MutableDictionary)
--- /dev/null
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+#include "config.h"
+#include "WKGraphicsContextCG.h"
+
+#include "WKSharedAPICast.h"
+#include "WebGraphicsContext.h"
+
+using namespace WebKit;
+
+CGContextRef WKGraphicsContextGetCGContext(WKGraphicsContextRef graphicsContextRef)
+{
+ return toImpl(graphicsContextRef)->platformContext();
+}
--- /dev/null
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKGraphicsContextCG_h
+#define WKGraphicsContextCG_h
+
+#include <CoreGraphics/CGContext.h>
+#include <WebKit2/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT CGContextRef WKGraphicsContextGetCGContext(WKGraphicsContextRef graphicsContext);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKGraphicsContextCG_h */
TypeData,
TypeDictionary,
TypeError,
+ TypeGraphicsContext,
TypeImage,
TypeProtectionSpace,
TypeSecurityOrigin,
--- /dev/null
+/*
+ * WebGraphicsContext.cpp
+ * WebKit2
+ *
+ * Created by Sam Weinig on 2/1/11.
+ * Copyright 2011 Apple Inc. All rights reserved.
+ *
+ */
+
+#include "config.h"
+#include "WebGraphicsContext.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+WebGraphicsContext::WebGraphicsContext(GraphicsContext* graphicsContext)
+#if PLATFORM(CG)
+ : m_platformContext(graphicsContext->platformContext())
+#endif
+{
+}
+
+} // namespace WebKit
--- /dev/null
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebGraphicsContext_h
+#define WebGraphicsContext_h
+
+#include "APIObject.h"
+#include <WebCore/GraphicsContext.h>
+#include <wtf/PassRefPtr.h>
+
+#if PLATFORM(CG)
+#include <wtf/RetainPtr.h>
+#endif
+
+namespace WebKit {
+
+class WebGraphicsContext : public APIObject {
+public:
+ static const Type APIType = TypeGraphicsContext;
+
+ static PassRefPtr<WebGraphicsContext> create(WebCore::GraphicsContext* graphicsContext)
+ {
+ return adoptRef(new WebGraphicsContext(graphicsContext));
+ }
+
+#if PLATFORM(CG)
+ CGContextRef platformContext() { return m_platformContext.get(); }
+#endif
+
+private:
+ explicit WebGraphicsContext(WebCore::GraphicsContext*);
+
+ virtual Type type() const { return APIType; }
+
+#if PLATFORM(CG)
+ RetainPtr<CGContextRef> m_platformContext;
+#endif
+};
+
+} // namespace WebKit
+
+#endif // WebGraphicsContext_h
#include <WebKit2/WKGeolocationManager.h>
#include <WebKit2/WKGeolocationPermissionRequest.h>
#include <WebKit2/WKGeolocationPosition.h>
+#include <WebKit2/WKGraphicsContext.h>
#include <WebKit2/WKMutableArray.h>
#include <WebKit2/WKMutableDictionary.h>
#include <WebKit2/WKNavigationData.h>
Shared/API/c/WKContextMenuItem.h \
Shared/API/c/WKContextMenuItemTypes.h \
Shared/API/c/WKGeometry.h \
+ Shared/API/c/WKGraphicsContext.h \
Shared/API/c/WKImage.h \
Shared/API/c/WKNumber.h \
Shared/API/c/WKPageLoadTypes.h \
Shared/WebEventConversion.h \
Shared/WebFindOptions.h \
Shared/WebGeolocationPosition.h \
+ Shared/WebGraphicsContext.h \
Shared/WebImage.h \
Shared/WebNavigationDataStore.h \
Shared/WebNumber.h \
Shared/API/c/WKArray.cpp \
Shared/API/c/WKCertificateInfo.cpp \
Shared/API/c/WKContextMenuItem.cpp \
+ Shared/API/c/WKGraphicsContext.cpp \
Shared/API/c/WKImage.cpp \
Shared/API/c/WKNumber.cpp \
Shared/API/c/WKSecurityOrigin.cpp \
Shared/WebEvent.cpp \
Shared/WebEventConversion.cpp \
Shared/WebGeolocationPosition.cpp \
+ Shared/WebGraphicsContext.cpp \
Shared/WebKeyboardEvent.cpp \
Shared/WebImage.cpp \
Shared/WebMouseEvent.cpp \
BCA0EF8012331E78007D3CFB /* WebEditCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA0EF7E12331E78007D3CFB /* WebEditCommand.cpp */; };
BCA0EF9F12332642007D3CFB /* WebEditCommandProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA0EF9D12332642007D3CFB /* WebEditCommandProxy.h */; };
BCA0EFA012332642007D3CFB /* WebEditCommandProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA0EF9E12332642007D3CFB /* WebEditCommandProxy.cpp */; };
+ BCA56A1C12F9028E00C566C7 /* WebGraphicsContext.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA56A1A12F9028E00C566C7 /* WebGraphicsContext.h */; };
+ BCA56A1D12F9028E00C566C7 /* WebGraphicsContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA56A1B12F9028E00C566C7 /* WebGraphicsContext.cpp */; };
+ BCA56A6512F9C8F900C566C7 /* WKGraphicsContext.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA56A6312F9C8F900C566C7 /* WKGraphicsContext.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ BCA56A6612F9C8F900C566C7 /* WKGraphicsContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA56A6412F9C8F900C566C7 /* WKGraphicsContext.cpp */; };
+ BCA56A6912F9C9AD00C566C7 /* WKGraphicsContextCG.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA56A6712F9C9AD00C566C7 /* WKGraphicsContextCG.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ BCA56A6A12F9C9AD00C566C7 /* WKGraphicsContextCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA56A6812F9C9AD00C566C7 /* WKGraphicsContextCG.cpp */; };
BCA8C6A811E3BA5F00812FB7 /* InjectedBundlePageLoaderClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA8C6A611E3BA5F00812FB7 /* InjectedBundlePageLoaderClient.cpp */; };
BCA8C6A911E3BA5F00812FB7 /* InjectedBundlePageLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA8C6A711E3BA5F00812FB7 /* InjectedBundlePageLoaderClient.h */; };
BCA8C6AF11E3C08700812FB7 /* InjectedBundlePageUIClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA8C6AD11E3C08700812FB7 /* InjectedBundlePageUIClient.cpp */; };
BCA0EF7E12331E78007D3CFB /* WebEditCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebEditCommand.cpp; sourceTree = "<group>"; };
BCA0EF9D12332642007D3CFB /* WebEditCommandProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebEditCommandProxy.h; sourceTree = "<group>"; };
BCA0EF9E12332642007D3CFB /* WebEditCommandProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebEditCommandProxy.cpp; sourceTree = "<group>"; };
+ BCA56A1A12F9028E00C566C7 /* WebGraphicsContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGraphicsContext.h; sourceTree = "<group>"; };
+ BCA56A1B12F9028E00C566C7 /* WebGraphicsContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebGraphicsContext.cpp; sourceTree = "<group>"; };
+ BCA56A6312F9C8F900C566C7 /* WKGraphicsContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKGraphicsContext.h; sourceTree = "<group>"; };
+ BCA56A6412F9C8F900C566C7 /* WKGraphicsContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKGraphicsContext.cpp; sourceTree = "<group>"; };
+ BCA56A6712F9C9AD00C566C7 /* WKGraphicsContextCG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKGraphicsContextCG.h; sourceTree = "<group>"; };
+ BCA56A6812F9C9AD00C566C7 /* WKGraphicsContextCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKGraphicsContextCG.cpp; sourceTree = "<group>"; };
BCA8C6A611E3BA5F00812FB7 /* InjectedBundlePageLoaderClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundlePageLoaderClient.cpp; sourceTree = "<group>"; };
BCA8C6A711E3BA5F00812FB7 /* InjectedBundlePageLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundlePageLoaderClient.h; sourceTree = "<group>"; };
BCA8C6AD11E3C08700812FB7 /* InjectedBundlePageUIClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundlePageUIClient.cpp; sourceTree = "<group>"; };
1A90C1ED1264FD50003E44D4 /* WebFindOptions.h */,
BC0E607212D6BC200012A72A /* WebGeolocationPosition.cpp */,
BC0E607112D6BC200012A72A /* WebGeolocationPosition.h */,
+ BCA56A1B12F9028E00C566C7 /* WebGraphicsContext.cpp */,
+ BCA56A1A12F9028E00C566C7 /* WebGraphicsContext.h */,
BCCF6ABA12C91EF9008F9C35 /* WebImage.cpp */,
BCCF6ABB12C91EF9008F9C35 /* WebImage.h */,
C0337DD2127A2A0E008FF4F4 /* WebKeyboardEvent.cpp */,
BCCF6AC412C91F3B008F9C35 /* cg */ = {
isa = PBXGroup;
children = (
+ BCA56A6812F9C9AD00C566C7 /* WKGraphicsContextCG.cpp */,
+ BCA56A6712F9C9AD00C566C7 /* WKGraphicsContextCG.h */,
BCCF6AC712C91F59008F9C35 /* WKImageCG.cpp */,
BCCF6AC812C91F59008F9C35 /* WKImageCG.h */,
);
BC40783C1250FADD0068F20A /* WKEvent.h */,
37F623B712A57B6200E3FDF6 /* WKFindOptions.h */,
BCC8B373125FB69000DE46A4 /* WKGeometry.h */,
+ BCA56A6412F9C8F900C566C7 /* WKGraphicsContext.cpp */,
+ BCA56A6312F9C8F900C566C7 /* WKGraphicsContext.h */,
BCCF6AC012C91F34008F9C35 /* WKImage.cpp */,
BCCF6AC112C91F34008F9C35 /* WKImage.h */,
BC4075E1124FF0270068F20A /* WKMutableArray.cpp */,
1A9639F712F38ECD0078A062 /* CoreAnimationRenderer.h in Headers */,
1A690D1712F39E3300ECD289 /* LayerTreeHostMac.h in Headers */,
1A92DC1112F8BA460017AF65 /* LayerTreeContext.h in Headers */,
+ BCA56A1C12F9028E00C566C7 /* WebGraphicsContext.h in Headers */,
+ BCA56A6512F9C8F900C566C7 /* WKGraphicsContext.h in Headers */,
+ BCA56A6912F9C9AD00C566C7 /* WKGraphicsContextCG.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
1A9636BC12F348490078A062 /* ShareableSurface.cpp in Sources */,
1A9639F812F38ECD0078A062 /* CoreAnimationRenderer.mm in Sources */,
1A92DC1312F8BAB90017AF65 /* LayerTreeContextMac.mm in Sources */,
+ BCA56A1D12F9028E00C566C7 /* WebGraphicsContext.cpp in Sources */,
+ BCA56A6612F9C8F900C566C7 /* WKGraphicsContext.cpp in Sources */,
+ BCA56A6A12F9C9AD00C566C7 /* WKGraphicsContextCG.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
typedef void (*WKBundlePageWillRunJavaScriptPromptCallback)(WKBundlePageRef page, WKStringRef message, WKStringRef defaultValue, WKBundleFrameRef frame, const void *clientInfo);
typedef void (*WKBundlePageMouseDidMoveOverElementCallback)(WKBundlePageRef page, WKBundleHitTestResultRef hitTestResult, WKEventModifiers modifiers, WKTypeRef* userData, const void *clientInfo);
typedef void (*WKBundlePageDidScrollCallback)(WKBundlePageRef page, const void *clientInfo);
+typedef void (*WKBundlePagePaintCustomOverhangAreaCallback)(WKBundlePageRef page, WKGraphicsContextRef graphicsContext, WKRect horizontalOverhang, WKRect verticalOverhang, WKRect dirtyRect, const void* clientInfo);
struct WKBundlePageUIClient {
int version;
WKBundlePageWillRunJavaScriptPromptCallback willRunJavaScriptPrompt;
WKBundlePageMouseDidMoveOverElementCallback mouseDidMoveOverElement;
WKBundlePageDidScrollCallback pageDidScroll;
+ WKBundlePagePaintCustomOverhangAreaCallback paintCustomOverhangArea;
};
typedef struct WKBundlePageUIClient WKBundlePageUIClient;
#include "InjectedBundleHitTestResult.h"
#include "WKAPICast.h"
+#include "WebGraphicsContext.h"
#include "WKBundleAPICast.h"
#include <wtf/text/WTFString.h>
void InjectedBundlePageUIClient::pageDidScroll(WebPage* page)
{
- if (m_client.pageDidScroll)
- m_client.pageDidScroll(toAPI(page), m_client.clientInfo);
+ if (!m_client.pageDidScroll)
+ return;
+
+ m_client.pageDidScroll(toAPI(page), m_client.clientInfo);
+}
+
+bool InjectedBundlePageUIClient::shouldPaintCustomOverhangArea()
+{
+ return m_client.paintCustomOverhangArea;
+}
+
+void InjectedBundlePageUIClient::paintCustomOverhangArea(WebPage* page, GraphicsContext* graphicsContext, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect)
+{
+ ASSERT(shouldPaintCustomOverhangArea());
+
+ RefPtr<WebGraphicsContext> context = WebGraphicsContext::create(graphicsContext);
+ m_client.paintCustomOverhangArea(toAPI(page), toAPI(context.get()), toAPI(horizontalOverhangArea), toAPI(verticalOverhangArea), toAPI(dirtyRect), m_client.clientInfo);
}
} // namespace WebKit
#include <wtf/Forward.h>
namespace WebCore {
+ class GraphicsContext;
class HitTestResult;
+ class IntRect;
}
namespace WebKit {
void willRunJavaScriptPrompt(WebPage*, const String&, const String&, WebFrame*);
void mouseDidMoveOverElement(WebPage*, const WebCore::HitTestResult&, WebEvent::Modifiers, RefPtr<APIObject>& userData);
void pageDidScroll(WebPage*);
+
+ bool shouldPaintCustomOverhangArea();
+ void paintCustomOverhangArea(WebPage*, WebCore::GraphicsContext*, const WebCore::IntRect&, const WebCore::IntRect&, const WebCore::IntRect&);
};
} // namespace WebKit
return false;
}
+bool WebChromeClient::paintCustomOverhangArea(GraphicsContext* context, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect)
+{
+ if (!m_page->injectedBundleUIClient().shouldPaintCustomOverhangArea())
+ return false;
+
+ m_page->injectedBundleUIClient().paintCustomOverhangArea(m_page, context, horizontalOverhangArea, verticalOverhangArea, dirtyRect);
+ return true;
+}
+
void WebChromeClient::requestGeolocationPermissionForFrame(Frame*, Geolocation*)
{
notImplemented();
WebCore::ScrollbarControlState, WebCore::ScrollbarPart pressedPart, bool vertical,
float value, float proportion, WebCore::ScrollbarControlPartMask);
virtual bool paintCustomScrollCorner(WebCore::GraphicsContext*, const WebCore::FloatRect&);
-
+
+ virtual bool paintCustomOverhangArea(WebCore::GraphicsContext*, const WebCore::IntRect&, const WebCore::IntRect&, const WebCore::IntRect&);
+
// This is an asynchronous call. The ChromeClient can display UI asking the user for permission
// to use Geolococation. The ChromeClient must call Geolocation::setShouldClearCache() appropriately.
virtual void requestGeolocationPermissionForFrame(WebCore::Frame*, WebCore::Geolocation*);
RelativePath="..\Shared\WebGeolocationPosition.h"
>
</File>
+ <File
+ RelativePath="..\Shared\WebGraphicsContext.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\Shared\WebGraphicsContext.h"
+ >
+ </File>
<File
RelativePath="..\Shared\WebImage.cpp"
>
RelativePath="..\Shared\API\c\WKGeometry.h"
>
</File>
+ <File
+ RelativePath="..\Shared\API\c\WKGraphicsContext.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\Shared\API\c\WKGraphicsContext.h"
+ >
+ </File>
<File
RelativePath="..\Shared\API\c\WKImage.cpp"
>
RelativePath="..\Shared\API\c\cg\WKImageCG.h"
>
</File>
+ <File
+ RelativePath="..\Shared\API\c\cg\WKGraphicsContextCG.cpp"
+ >
+ <FileConfiguration
+ Name="Debug_Cairo_CFLite|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo_CFLite|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\Shared\API\c\cg\WKGraphicsContextCG.h"
+ >
+ </File>
</Filter>
</Filter>
<Filter
xcopy /y /d "..\Shared\API\c\cf\WKURLRequestCF.h" "%ConfigurationBuildDir%\include\WebKit2"
xcopy /y /d "..\Shared\API\c\cf\WKURLResponseCF.h" "%ConfigurationBuildDir%\include\WebKit2"
xcopy /y /d "..\Shared\API\c\cg\WKImageCG.h" "%ConfigurationBuildDir%\include\WebKit2"
+ xcopy /y /d "..\Shared\API\c\cg\WKGraphicsContextCG.h" "%ConfigurationBuildDir%\include\WebKit2"
xcopy /y /d "..\Shared\API\c\win\WKBaseWin.h" "%ConfigurationBuildDir%\include\WebKit2"
xcopy /y /d "..\Shared\API\c\win\WKCertificateInfoWin.h" "%ConfigurationBuildDir%\include\WebKit2"
xcopy /y /d "..\Shared\API\c\WKArray.h" "%ConfigurationBuildDir%\include\WebKit2"
xcopy /y /d "..\Shared\API\c\WKEvent.h" "%ConfigurationBuildDir%\include\WebKit2"
xcopy /y /d "..\Shared\API\c\WKFindOptions.h" "%ConfigurationBuildDir%\include\WebKit2"
xcopy /y /d "..\Shared\API\c\WKGeometry.h" "%ConfigurationBuildDir%\include\WebKit2"
+ xcopy /y /d "..\Shared\API\c\WKGraphicsContext.h" "%ConfigurationBuildDir%\include\WebKit2"
xcopy /y /d "..\Shared\API\c\WKImage.h" "%ConfigurationBuildDir%\include\WebKit2"
xcopy /y /d "..\Shared\API\c\WKMutableArray.h" "%ConfigurationBuildDir%\include\WebKit2"
xcopy /y /d "..\Shared\API\c\WKMutableDictionary.h" "%ConfigurationBuildDir%\include\WebKit2"
+2011-02-02 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Beth Dakin.
+
+ Add ChromeClient function to paint custom overhang areas.
+ https://bugs.webkit.org/show_bug.cgi?id=53639
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::InjectedBundlePage):
+ Stub out new callback.
+
2011-02-02 Dirk Pranke <dpranke@chromium.org>
Reviewed by Tony Chang.
willRunJavaScriptPrompt,
0, /*mouseDidMoveOverElement*/
0, /*pageDidScroll*/
+ 0, /*paintCustomOverhangArea*/
};
WKBundlePageSetUIClient(m_page, &uiClient);