summaryrefslogtreecommitdiff
path: root/Source/WebKit2
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-02-24 16:36:50 +0100
committerSimon Hausmann <simon.hausmann@nokia.com>2012-02-24 16:36:50 +0100
commitad0d549d4cc13433f77c1ac8f0ab379c83d93f28 (patch)
treeb34b0daceb7c8e7fdde4b4ec43650ab7caadb0a9 /Source/WebKit2
parent03e12282df9aa1e1fb05a8b90f1cfc2e08764cec (diff)
downloadqtwebkit-ad0d549d4cc13433f77c1ac8f0ab379c83d93f28.tar.gz
Imported WebKit commit bb52bf3c0119e8a128cd93afe5572413a8617de9 (http://svn.webkit.org/repository/webkit/trunk@108790)
Diffstat (limited to 'Source/WebKit2')
-rw-r--r--Source/WebKit2/CMakeLists.txt228
-rw-r--r--Source/WebKit2/ChangeLog2198
-rw-r--r--Source/WebKit2/Configurations/Base.xcconfig6
-rw-r--r--Source/WebKit2/Configurations/FeatureDefines.xcconfig5
-rw-r--r--Source/WebKit2/Configurations/Version.xcconfig2
-rw-r--r--Source/WebKit2/GNUmakefile.am27
-rw-r--r--Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.cpp10
-rw-r--r--Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.h6
-rw-r--r--Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp7
-rw-r--r--Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.h6
-rw-r--r--Source/WebKit2/Platform/CoreIPC/HandleMessage.h6
-rw-r--r--Source/WebKit2/Platform/WorkQueue.h2
-rw-r--r--Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp3
-rw-r--r--Source/WebKit2/PlatformEfl.cmake50
-rw-r--r--Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp8
-rw-r--r--Source/WebKit2/Shared/ShareableBitmap.h2
-rw-r--r--Source/WebKit2/Shared/WebPreferencesStore.h5
-rw-r--r--Source/WebKit2/Shared/gtk/WebCoreArgumentCodersGtk.cpp26
-rw-r--r--Source/WebKit2/Shared/qt/ShareableBitmapQt.cpp21
-rw-r--r--Source/WebKit2/Shared/qt/WebEventFactoryQt.cpp7
-rw-r--r--Source/WebKit2/Target.pri8
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKInspector.cpp10
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKInspector.h2
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPage.h3
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPreferences.cpp18
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPreferences.h4
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h4
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitDefines.h2
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.cpp430
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.h102
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResultPrivate.h29
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp3
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp17
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperation.cpp410
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperation.h95
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperationPrivate.h28
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.cpp37
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h2
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp59
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitSettings.h7
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp14
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp101
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h54
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h2
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp2
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml2
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt56
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/tests/GNUmakefile.am13
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/tests/TestPrinting.cpp152
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitSettings.cpp5
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebView.cpp82
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.cpp50
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.h4
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/webkit2.h2
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/webkit2marshal.list1
-rw-r--r--Source/WebKit2/UIProcess/API/mac/WKView.mm3
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp74
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp218
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h48
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h21
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qtwebsecurityorigin.cpp60
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qtwebsecurityorigin_p.h57
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qwebnavigationrequest.cpp14
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qwebnavigationrequest_p.h6
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qwebpermissionrequest.cpp24
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qwebpermissionrequest_p.h11
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qwebpreferences.cpp16
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qwebpreferences_p.h5
-rw-r--r--Source/WebKit2/UIProcess/API/qt/tests/bytearraytestdata.h1
-rw-r--r--Source/WebKit2/UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp7
-rw-r--r--Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView.pro3
-rw-r--r--Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_origin.qml57
-rw-r--r--Source/WebKit2/UIProcess/API/qt/tests/qmltests/tst_qmltests.cpp4
-rw-r--r--Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp6
-rw-r--r--Source/WebKit2/UIProcess/API/qt/tests/tests.pri2
-rw-r--r--Source/WebKit2/UIProcess/API/qt/tests/util.h10
-rw-r--r--Source/WebKit2/UIProcess/BackingStore.h16
-rw-r--r--Source/WebKit2/UIProcess/DrawingAreaProxy.h4
-rw-r--r--Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp8
-rw-r--r--Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h4
-rw-r--r--Source/WebKit2/UIProcess/Launcher/mac/ThreadLauncherMac.mm4
-rw-r--r--Source/WebKit2/UIProcess/Launcher/qt/ThreadLauncherQt.cpp4
-rw-r--r--Source/WebKit2/UIProcess/Launcher/win/ThreadLauncherWin.cpp4
-rw-r--r--Source/WebKit2/UIProcess/LayerTreeHostProxy.h26
-rw-r--r--Source/WebKit2/UIProcess/PageClient.h1
-rw-r--r--Source/WebKit2/UIProcess/WebInspectorProxy.cpp32
-rw-r--r--Source/WebKit2/UIProcess/WebInspectorProxy.h5
-rw-r--r--Source/WebKit2/UIProcess/WebLoaderClient.cpp13
-rw-r--r--Source/WebKit2/UIProcess/WebLoaderClient.h1
-rw-r--r--Source/WebKit2/UIProcess/WebPageProxy.cpp83
-rw-r--r--Source/WebKit2/UIProcess/WebPageProxy.h4
-rw-r--r--Source/WebKit2/UIProcess/WebPageProxy.messages.in4
-rw-r--r--Source/WebKit2/UIProcess/WebProcessProxy.cpp14
-rw-r--r--Source/WebKit2/UIProcess/cf/WebPageProxyCF.cpp9
-rw-r--r--Source/WebKit2/UIProcess/mac/BackingStoreMac.mm142
-rw-r--r--Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm2
-rw-r--r--Source/WebKit2/UIProcess/qt/LayerBackingStore.cpp143
-rw-r--r--Source/WebKit2/UIProcess/qt/LayerBackingStore.h68
-rw-r--r--Source/WebKit2/UIProcess/qt/LayerTreeHostProxyQt.cpp192
-rw-r--r--Source/WebKit2/UIProcess/qt/QtDialogRunner.cpp46
-rw-r--r--Source/WebKit2/UIProcess/qt/QtDialogRunner.h1
-rw-r--r--Source/WebKit2/UIProcess/qt/QtFlickProvider.cpp224
-rw-r--r--Source/WebKit2/UIProcess/qt/QtFlickProvider.h98
-rw-r--r--Source/WebKit2/UIProcess/qt/QtPageClient.cpp11
-rw-r--r--Source/WebKit2/UIProcess/qt/QtPageClient.h1
-rw-r--r--Source/WebKit2/UIProcess/qt/QtPanGestureRecognizer.cpp10
-rw-r--r--Source/WebKit2/UIProcess/qt/QtPanGestureRecognizer.h4
-rw-r--r--Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp199
-rw-r--r--Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h33
-rw-r--r--Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp14
-rw-r--r--Source/WebKit2/UIProcess/qt/QtWebPagePolicyClient.cpp30
-rw-r--r--Source/WebKit2/UIProcess/qt/QtWebPagePolicyClient.h4
-rw-r--r--Source/WebKit2/UIProcess/win/WebPopupMenuProxyWin.cpp4
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp1
-rw-r--r--Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp45
-rw-r--r--Source/WebKit2/WebProcess/Notifications/WebNotificationManager.h6
-rw-r--r--Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp6
-rw-r--r--Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.h1
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h1
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.h2
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp6
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h4
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp7
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.cpp235
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.h23
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp71
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h21
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp32
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm14
-rw-r--r--Source/WebKit2/WebProcess/WebPage/DecoderAdapter.cpp5
-rw-r--r--Source/WebKit2/WebProcess/WebPage/DecoderAdapter.h1
-rw-r--r--Source/WebKit2/WebProcess/WebPage/DrawingArea.h1
-rw-r--r--Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in1
-rw-r--r--Source/WebKit2/WebProcess/WebPage/EncoderAdapter.cpp5
-rw-r--r--Source/WebKit2/WebProcess/WebPage/EncoderAdapter.h1
-rw-r--r--Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp22
-rw-r--r--Source/WebKit2/WebProcess/WebPage/EventDispatcher.h4
-rw-r--r--Source/WebKit2/WebProcess/WebPage/EventDispatcher.messages.in2
-rw-r--r--Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h6
-rw-r--r--Source/WebKit2/WebProcess/WebPage/LayerTreeHost.messages.in4
-rw-r--r--Source/WebKit2/WebProcess/WebPage/TiledBackingStoreRemoteTile.cpp26
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.cpp4
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebFrame.cpp2
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebInspector.cpp19
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebInspector.h4
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebInspector.messages.in2
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebPage.cpp27
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebPage.h16
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebPage.messages.in11
-rw-r--r--Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp347
-rw-r--r--Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.h29
-rw-r--r--Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h2
-rw-r--r--Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm18
-rw-r--r--Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp72
-rw-r--r--Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.h15
-rw-r--r--Source/WebKit2/WebProcess/WebProcess.cpp4
-rw-r--r--Source/WebKit2/WebProcess/com.apple.WebProcess.sb3
-rw-r--r--Source/WebKit2/WebProcess/efl/WebProcessMainEfl.cpp2
-rw-r--r--Source/WebKit2/WebProcess/gtk/WebProcessMainGtk.cpp8
-rw-r--r--Source/WebKit2/WebProcess/qt/QtNetworkAccessManager.cpp27
-rw-r--r--Source/WebKit2/WebProcess/qt/QtNetworkAccessManager.h2
-rw-r--r--Source/WebKit2/win/WebKit2.def8
-rw-r--r--Source/WebKit2/win/WebKit2CFLite.def9
163 files changed, 6696 insertions, 1032 deletions
diff --git a/Source/WebKit2/CMakeLists.txt b/Source/WebKit2/CMakeLists.txt
index 0414d1333..0dc836c00 100644
--- a/Source/WebKit2/CMakeLists.txt
+++ b/Source/WebKit2/CMakeLists.txt
@@ -17,6 +17,7 @@ SET(WebKit2_INCLUDE_DIRECTORIES
"${WEBKIT2_DIR}/UIProcess/Authentication"
"${WEBKIT2_DIR}/UIProcess/Downloads"
"${WEBKIT2_DIR}/UIProcess/Launcher"
+ "${WEBKIT2_DIR}/UIProcess/Notifications"
"${WEBKIT2_DIR}/UIProcess/Plugins"
"${WEBKIT2_DIR}/WebProcess"
"${WEBKIT2_DIR}/WebProcess/ApplicationCache"
@@ -33,6 +34,7 @@ SET(WebKit2_INCLUDE_DIRECTORIES
"${WEBKIT2_DIR}/WebProcess/KeyValueStorage"
"${WEBKIT2_DIR}/WebProcess/Launching"
"${WEBKIT2_DIR}/WebProcess/MediaCache"
+ "${WEBKIT2_DIR}/WebProcess/Notifications"
"${WEBKIT2_DIR}/WebProcess/ResourceCache"
"${WEBKIT2_DIR}/WebProcess/Plugins"
"${WEBKIT2_DIR}/WebProcess/Plugins/Netscape"
@@ -49,6 +51,7 @@ SET(WebKit2_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/editing"
"${WEBCORE_DIR}/history"
"${WEBCORE_DIR}/html"
+ "${WEBCORE_DIR}/inspector"
"${WEBCORE_DIR}/loader"
"${WEBCORE_DIR}/loader/icon"
"${WEBCORE_DIR}/loader/cache"
@@ -57,6 +60,7 @@ SET(WebKit2_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/platform"
"${WEBCORE_DIR}/platform/animation"
"${WEBCORE_DIR}/platform/graphics"
+ "${WEBCORE_DIR}/platform/graphics/filters"
"${WEBCORE_DIR}/platform/graphics/transforms"
"${WEBCORE_DIR}/platform/network"
"${WEBCORE_DIR}/platform/sql"
@@ -91,6 +95,10 @@ SET(WebKit2_INCLUDE_DIRECTORIES
)
SET(WebKit2_SOURCES
+ Platform/Logging.cpp
+ Platform/Module.cpp
+ Platform/WorkQueue.cpp
+
Platform/CoreIPC/ArgumentCoders.cpp
Platform/CoreIPC/ArgumentDecoder.cpp
Platform/CoreIPC/ArgumentEncoder.cpp
@@ -99,38 +107,17 @@ SET(WebKit2_SOURCES
Platform/CoreIPC/Connection.cpp
Platform/CoreIPC/DataReference.cpp
- Platform/Logging.cpp
- Platform/Module.cpp
- Platform/RunLoop.cpp
- Platform/WorkQueue.cpp
-
PluginProcess/PluginControllerProxy.cpp
+ PluginProcess/PluginCreationParameters.cpp
PluginProcess/PluginProcess.cpp
PluginProcess/WebProcessConnection.cpp
- Shared/API/c/WKArray.cpp
- Shared/API/c/WKCertificateInfo.cpp
- Shared/API/c/WKContextMenuItem.cpp
- Shared/API/c/WKData.cpp
- Shared/API/c/WKDictionary.cpp
- Shared/API/c/WKError.cpp
- Shared/API/c/WKGraphicsContext.cpp
- Shared/API/c/WKImage.cpp
- Shared/API/c/WKMutableArray.cpp
- Shared/API/c/WKMutableDictionary.cpp
- Shared/API/c/WKNumber.cpp
- Shared/API/c/WKSecurityOrigin.cpp
- Shared/API/c/WKSerializedScriptValue.cpp
- Shared/API/c/WKString.cpp
- Shared/API/c/WKType.cpp
- Shared/API/c/WKURL.cpp
- Shared/API/c/WKURLRequest.cpp
- Shared/API/c/WKURLResponse.cpp
- Shared/API/c/WKUserContentURLPattern.cpp
-
Shared/APIClientTraits.cpp
Shared/APIObject.cpp
Shared/ChildProcess.cpp
+ Shared/DictionaryPopupInfo.cpp
+ Shared/EditorState.cpp
+ Shared/FontInfo.cpp
Shared/ImmutableArray.cpp
Shared/ImmutableDictionary.cpp
Shared/MutableArray.cpp
@@ -145,6 +132,8 @@ SET(WebKit2_SOURCES
Shared/UpdateInfo.cpp
Shared/VisitedLinkTable.cpp
Shared/WebBackForwardListItem.cpp
+ Shared/WebConnection.cpp
+ Shared/WebConnectionClient.cpp
Shared/WebContextMenuItem.cpp
Shared/WebContextMenuItemData.cpp
Shared/WebCoreArgumentCoders.cpp
@@ -152,10 +141,12 @@ SET(WebKit2_SOURCES
Shared/WebEvent.cpp
Shared/WebEventConversion.cpp
Shared/WebGeolocationPosition.cpp
+ Shared/WebGestureEvent.cpp
Shared/WebGraphicsContext.cpp
Shared/WebHitTestResult.cpp
Shared/WebImage.cpp
Shared/WebKeyboardEvent.cpp
+ Shared/WebMemorySampler.cpp
Shared/WebMouseEvent.cpp
Shared/WebOpenPanelParameters.cpp
Shared/WebPageCreationParameters.cpp
@@ -169,49 +160,39 @@ SET(WebKit2_SOURCES
Shared/WebURLResponse.cpp
Shared/WebWheelEvent.cpp
+ Shared/API/c/WKArray.cpp
+ Shared/API/c/WKCertificateInfo.cpp
+ Shared/API/c/WKConnectionRef.cpp
+ Shared/API/c/WKContextMenuItem.cpp
+ Shared/API/c/WKData.cpp
+ Shared/API/c/WKDictionary.cpp
+ Shared/API/c/WKError.cpp
+ Shared/API/c/WKGeometry.cpp
+ Shared/API/c/WKGraphicsContext.cpp
+ Shared/API/c/WKImage.cpp
+ Shared/API/c/WKMutableArray.cpp
+ Shared/API/c/WKMutableDictionary.cpp
+ Shared/API/c/WKNumber.cpp
+ Shared/API/c/WKSecurityOrigin.cpp
+ Shared/API/c/WKSerializedScriptValue.cpp
+ Shared/API/c/WKString.cpp
+ Shared/API/c/WKType.cpp
+ Shared/API/c/WKURL.cpp
+ Shared/API/c/WKURLRequest.cpp
+ Shared/API/c/WKURLResponse.cpp
+ Shared/API/c/WKUserContentURLPattern.cpp
+
Shared/Plugins/NPIdentifierData.cpp
Shared/Plugins/NPObjectMessageReceiver.cpp
Shared/Plugins/NPObjectProxy.cpp
Shared/Plugins/NPRemoteObjectMap.cpp
Shared/Plugins/NPVariantData.cpp
+ Shared/Plugins/PluginModuleInfo.cpp
Shared/Plugins/PluginProcessCreationParameters.cpp
Shared/Plugins/Netscape/NetscapePluginModule.cpp
Shared/Plugins/Netscape/NetscapePluginModuleNone.cpp
- UIProcess/API/C/WKApplicationCacheManager.cpp
- UIProcess/API/C/WKAuthenticationChallenge.cpp
- UIProcess/API/C/WKAuthenticationDecisionListener.cpp
- UIProcess/API/C/WKBackForwardList.cpp
- UIProcess/API/C/WKBackForwardListItem.cpp
- UIProcess/API/C/WKContext.cpp
- UIProcess/API/C/WKCookieManager.cpp
- UIProcess/API/C/WKCredential.cpp
- UIProcess/API/C/WKDatabaseManager.cpp
- UIProcess/API/C/WKDownload.cpp
- UIProcess/API/C/WKFormSubmissionListener.cpp
- UIProcess/API/C/WKFrame.cpp
- UIProcess/API/C/WKFramePolicyListener.cpp
- UIProcess/API/C/WKGeolocationManager.cpp
- UIProcess/API/C/WKGeolocationPermissionRequest.cpp
- UIProcess/API/C/WKGeolocationPosition.cpp
- UIProcess/API/C/WKGrammarDetail.cpp
- UIProcess/API/C/WKHitTestResult.cpp
- UIProcess/API/C/WKIconDatabase.cpp
- UIProcess/API/C/WKInspector.cpp
- UIProcess/API/C/WKKeyValueStorageManager.cpp
- UIProcess/API/C/WKMediaCacheManager.cpp
- UIProcess/API/C/WKNavigationData.cpp
- UIProcess/API/C/WKOpenPanelParameters.cpp
- UIProcess/API/C/WKOpenPanelResultListener.cpp
- UIProcess/API/C/WKPage.cpp
- UIProcess/API/C/WKPageGroup.cpp
- UIProcess/API/C/WKPluginSiteDataManager.cpp
- UIProcess/API/C/WKPreferences.cpp
- UIProcess/API/C/WKProtectionSpace.cpp
- UIProcess/API/C/WKResourceCacheManager.cpp
- UIProcess/API/C/WKTextChecker.cpp
-
UIProcess/BackingStore.cpp
UIProcess/DrawingAreaProxy.cpp
UIProcess/DrawingAreaProxyImpl.cpp
@@ -222,7 +203,9 @@ SET(WebKit2_SOURCES
UIProcess/VisitedLinkProvider.cpp
UIProcess/WebApplicationCacheManagerProxy.cpp
UIProcess/WebBackForwardList.cpp
+ UIProcess/WebConnectionToWebProcess.cpp
UIProcess/WebContext.cpp
+ UIProcess/WebContextConnectionClient.cpp
UIProcess/WebContextInjectedBundleClient.cpp
UIProcess/WebContextMenuProxy.cpp
UIProcess/WebCookieManagerProxy.cpp
@@ -262,6 +245,42 @@ SET(WebKit2_SOURCES
UIProcess/WebTextCheckerClient.cpp
UIProcess/WebUIClient.cpp
+ UIProcess/API/C/WKApplicationCacheManager.cpp
+ UIProcess/API/C/WKAuthenticationChallenge.cpp
+ UIProcess/API/C/WKAuthenticationDecisionListener.cpp
+ UIProcess/API/C/WKBackForwardList.cpp
+ UIProcess/API/C/WKBackForwardListItem.cpp
+ UIProcess/API/C/WKContext.cpp
+ UIProcess/API/C/WKCookieManager.cpp
+ UIProcess/API/C/WKCredential.cpp
+ UIProcess/API/C/WKDatabaseManager.cpp
+ UIProcess/API/C/WKDownload.cpp
+ UIProcess/API/C/WKFormSubmissionListener.cpp
+ UIProcess/API/C/WKFrame.cpp
+ UIProcess/API/C/WKFramePolicyListener.cpp
+ UIProcess/API/C/WKGeolocationManager.cpp
+ UIProcess/API/C/WKGeolocationPermissionRequest.cpp
+ UIProcess/API/C/WKGeolocationPosition.cpp
+ UIProcess/API/C/WKGrammarDetail.cpp
+ UIProcess/API/C/WKHitTestResult.cpp
+ UIProcess/API/C/WKIconDatabase.cpp
+ UIProcess/API/C/WKInspector.cpp
+ UIProcess/API/C/WKKeyValueStorageManager.cpp
+ UIProcess/API/C/WKMediaCacheManager.cpp
+ UIProcess/API/C/WKNavigationData.cpp
+ UIProcess/API/C/WKNotification.cpp
+ UIProcess/API/C/WKNotificationManager.cpp
+ UIProcess/API/C/WKNotificationPermissionRequest.cpp
+ UIProcess/API/C/WKOpenPanelParameters.cpp
+ UIProcess/API/C/WKOpenPanelResultListener.cpp
+ UIProcess/API/C/WKPage.cpp
+ UIProcess/API/C/WKPageGroup.cpp
+ UIProcess/API/C/WKPluginSiteDataManager.cpp
+ UIProcess/API/C/WKPreferences.cpp
+ UIProcess/API/C/WKProtectionSpace.cpp
+ UIProcess/API/C/WKResourceCacheManager.cpp
+ UIProcess/API/C/WKTextChecker.cpp
+
UIProcess/Authentication/AuthenticationChallengeProxy.cpp
UIProcess/Authentication/AuthenticationDecisionListener.cpp
UIProcess/Authentication/WebCredential.cpp
@@ -272,11 +291,18 @@ SET(WebKit2_SOURCES
UIProcess/Launcher/ProcessLauncher.cpp
UIProcess/Launcher/ThreadLauncher.cpp
+ UIProcess/Notifications/NotificationPermissionRequest.cpp
+ UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp
+ UIProcess/Notifications/WebNotification.cpp
+ UIProcess/Notifications/WebNotificationManagerProxy.cpp
+ UIProcess/Notifications/WebNotificationProvider.cpp
+
UIProcess/Plugins/PluginInfoStore.cpp
UIProcess/Plugins/PluginProcessManager.cpp
UIProcess/Plugins/PluginProcessProxy.cpp
UIProcess/Plugins/WebPluginSiteDataManager.cpp
+ WebProcess/WebConnectionToUIProcess.cpp
WebProcess/WebKitMain.cpp
WebProcess/WebProcess.cpp
@@ -334,6 +360,9 @@ SET(WebKit2_SOURCES
WebProcess/MediaCache/WebMediaCacheManager.cpp
+ WebProcess/Notifications/NotificationPermissionRequestManager.cpp
+ WebProcess/Notifications/WebNotificationManager.cpp
+
WebProcess/Plugins/Plugin.cpp
WebProcess/Plugins/PluginProcessConnection.cpp
WebProcess/Plugins/PluginProcessConnectionManager.cpp
@@ -361,6 +390,7 @@ SET(WebKit2_SOURCES
WebProcess/WebCoreSupport/WebGeolocationClient.cpp
WebProcess/WebCoreSupport/WebInspectorClient.cpp
WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp
+ WebProcess/WebCoreSupport/WebNotificationClient.cpp
WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
WebProcess/WebCoreSupport/WebPopupMenu.cpp
WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp
@@ -369,55 +399,82 @@ SET(WebKit2_SOURCES
WebProcess/WebPage/DrawingArea.cpp
WebProcess/WebPage/DrawingAreaImpl.cpp
WebProcess/WebPage/EncoderAdapter.cpp
+ WebProcess/WebPage/EventDispatcher.cpp
WebProcess/WebPage/FindController.cpp
WebProcess/WebPage/LayerTreeHost.cpp
WebProcess/WebPage/PageOverlay.cpp
+ WebProcess/WebPage/TapHighlightController.cpp
WebProcess/WebPage/WebBackForwardListProxy.cpp
WebProcess/WebPage/WebContextMenu.cpp
- WebProcess/WebPage/WebUndoStep.cpp
WebProcess/WebPage/WebFrame.cpp
WebProcess/WebPage/WebInspector.cpp
WebProcess/WebPage/WebOpenPanelResultListener.cpp
WebProcess/WebPage/WebPage.cpp
WebProcess/WebPage/WebPageGroupProxy.cpp
+ WebProcess/WebPage/WebUndoStep.cpp
)
SET(WebKit2_MESSAGES_IN_FILES
- UIProcess/WebMediaCacheManagerProxy.messages.in
+ PluginProcess/PluginControllerProxy.messages.in
+ PluginProcess/PluginProcess.messages.in
+ PluginProcess/WebProcessConnection.messages.in
+
+ Shared/Plugins/NPObjectMessageReceiver.messages.in
+
+ UIProcess/DrawingAreaProxy.messages.in
+ UIProcess/LayerTreeHostProxy.messages.in
+ UIProcess/WebApplicationCacheManagerProxy.messages.in
+ UIProcess/WebContext.messages.in
UIProcess/WebCookieManagerProxy.messages.in
- UIProcess/Plugins/PluginProcessProxy.messages.in
- UIProcess/WebInspectorProxy.messages.in
- UIProcess/WebFullScreenManagerProxy.messages.in
UIProcess/WebDatabaseManagerProxy.messages.in
- UIProcess/WebPageProxy.messages.in
- UIProcess/WebIconDatabase.messages.in
- UIProcess/Downloads/DownloadProxy.messages.in
- UIProcess/WebContext.messages.in
+ UIProcess/WebFullScreenManagerProxy.messages.in
UIProcess/WebGeolocationManagerProxy.messages.in
- UIProcess/DrawingAreaProxy.messages.in
+ UIProcess/WebIconDatabase.messages.in
+ UIProcess/WebInspectorProxy.messages.in
UIProcess/WebKeyValueStorageManagerProxy.messages.in
- UIProcess/WebResourceCacheManagerProxy.messages.in
+ UIProcess/WebMediaCacheManagerProxy.messages.in
+ UIProcess/WebPageProxy.messages.in
UIProcess/WebProcessProxy.messages.in
- UIProcess/WebApplicationCacheManagerProxy.messages.in
- PluginProcess/WebProcessConnection.messages.in
- PluginProcess/PluginControllerProxy.messages.in
- PluginProcess/PluginProcess.messages.in
- Shared/Plugins/NPObjectMessageReceiver.messages.in
- WebProcess/ApplicationCache/WebApplicationCacheManager.messages.in
- WebProcess/MediaCache/WebMediaCacheManager.messages.in
- WebProcess/Plugins/PluginProxy.messages.in
+ UIProcess/WebResourceCacheManagerProxy.messages.in
+
+ UIProcess/Downloads/DownloadProxy.messages.in
+
+ UIProcess/Notifications/WebNotificationManagerProxy.messages.in
+
+ UIProcess/Plugins/PluginProcessProxy.messages.in
+
WebProcess/WebProcess.messages.in
- WebProcess/Geolocation/WebGeolocationManager.messages.in
- WebProcess/WebCoreSupport/WebDatabaseManager.messages.in
- WebProcess/IconDatabase/WebIconDatabaseProxy.messages.in
+
+ WebProcess/ApplicationCache/WebApplicationCacheManager.messages.in
+
WebProcess/Authentication/AuthenticationManager.messages.in
- WebProcess/ResourceCache/WebResourceCacheManager.messages.in
- WebProcess/FullScreen/WebFullScreenManager.messages.in
+
WebProcess/Cookies/WebCookieManager.messages.in
+
+ WebProcess/FullScreen/WebFullScreenManager.messages.in
+
+ WebProcess/Geolocation/WebGeolocationManager.messages.in
+
+ WebProcess/IconDatabase/WebIconDatabaseProxy.messages.in
+
WebProcess/KeyValueStorage/WebKeyValueStorageManager.messages.in
- WebProcess/WebPage/WebPage.messages.in
- WebProcess/WebPage/WebInspector.messages.in
+
+ WebProcess/MediaCache/WebMediaCacheManager.messages.in
+
+ WebProcess/Notifications/WebNotificationManager.messages.in
+
+ WebProcess/Plugins/PluginProcessConnection.messages.in
+ WebProcess/Plugins/PluginProxy.messages.in
+
+ WebProcess/ResourceCache/WebResourceCacheManager.messages.in
+
+ WebProcess/WebCoreSupport/WebDatabaseManager.messages.in
+
WebProcess/WebPage/DrawingArea.messages.in
+ WebProcess/WebPage/EventDispatcher.messages.in
+ WebProcess/WebPage/LayerTreeHost.messages.in
+ WebProcess/WebPage/WebInspector.messages.in
+ WebProcess/WebPage/WebPage.messages.in
)
# Create JavaScript C++ code given an IDL input
@@ -449,10 +506,9 @@ SET(WebProcess_LIBRARIES
SET(ForwardingHeaders_NAME )
SET(ForwardingNetworkHeaders_NAME )
-INCLUDE_IF_EXISTS(${WEBKIT2_DIR}/Platform${PORT}.cmake)
+WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
ADD_DEFINITIONS(-DBUILDING_WEBKIT)
-ADD_DEFINITIONS(-DWTF_USE_JSC=1)
INCLUDE_DIRECTORIES(${WebKit2_INCLUDE_DIRECTORIES})
ADD_LIBRARY(${WebKit2_LIBRARY_NAME} ${WebKit2_LIBRARY_TYPE} ${WebKit2_SOURCES})
diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog
index 35d30bb45..85a7f4bde 100644
--- a/Source/WebKit2/ChangeLog
+++ b/Source/WebKit2/ChangeLog
@@ -1,3 +1,2201 @@
+2012-02-24 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt] Use private QSGRenderNode in QQuickWebView for improved Qt Scene Graph integration
+ https://bugs.webkit.org/show_bug.cgi?id=79022
+
+ Reviewed by Csaba Osztrogonác.
+
+ * Target.pri:
+ * UIProcess/API/qt/qquickwebpage.cpp:
+ (PageProxyNode::PageProxyNode):
+ (PageProxyNode::changedStates):
+ (PageProxyNode::render):
+ (PageProxyNode):
+
+2012-02-24 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Encode/decode Null ResourceResponse objects in WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=79471
+
+ Reviewed by Philippe Normand.
+
+ * Shared/gtk/WebCoreArgumentCodersGtk.cpp:
+ (CoreIPC::::encode): Check whether ResourceResponse is Null before
+ encoding it.
+ (CoreIPC::::decode): Check whether response is Null and create a
+ Null ResourceResponse object in such case.
+
+2012-02-24 Shinya Kawanaka <shinyak@chromium.org>
+
+ SpellCheckRequest needs to know the context where the spellcheck happened.
+ https://bugs.webkit.org/show_bug.cgi?id=79320
+
+ Reviewed by Hajime Morita.
+
+ * WebProcess/WebCoreSupport/WebEditorClient.cpp:
+ (WebKit::WebEditorClient::requestCheckingOfString):
+ * WebProcess/WebCoreSupport/WebEditorClient.h:
+
+2012-02-23 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ [Qt] Tiling: Improve the method names dealing with moving and scaling.
+
+ Rubberstamped by Simon Hausmann.
+
+ * UIProcess/API/qt/qquickwebview.cpp:
+ (QQuickWebViewLegacyPrivate::updateViewportSize):
+ (QQuickWebViewFlickablePrivate::onComponentComplete):
+ (QQuickWebViewFlickablePrivate::updateViewportSize):
+ (QQuickWebViewFlickablePrivate::_q_commitScaleChange):
+ (QQuickWebViewPrivate::_q_commitPositionChange):
+ (QQuickWebViewFlickablePrivate::_q_resume):
+ * UIProcess/API/qt/qquickwebview_p.h:
+ * UIProcess/API/qt/qquickwebview_p_p.h:
+ (QQuickWebViewPrivate):
+ (QQuickWebViewPrivate::_q_commitScaleChange):
+ (QQuickWebViewFlickablePrivate):
+ * UIProcess/DrawingAreaProxy.h:
+ (WebKit::DrawingAreaProxy::setVisibleContentsRectForScaling):
+ (WebKit::DrawingAreaProxy::setVisibleContentsRectForPanning):
+ * UIProcess/DrawingAreaProxyImpl.cpp:
+ (WebKit::DrawingAreaProxyImpl::setVisibleContentsRectForScaling):
+ (WebKit::DrawingAreaProxyImpl::setVisibleContentsRectForPanning):
+ * UIProcess/DrawingAreaProxyImpl.h:
+ (DrawingAreaProxyImpl):
+ * UIProcess/LayerTreeHostProxy.h:
+ (LayerTreeHostProxy):
+ * UIProcess/qt/LayerTreeHostProxyQt.cpp:
+ (WebKit::LayerTreeHostProxy::setVisibleContentsRectForPanning):
+ (WebKit::LayerTreeHostProxy::setVisibleContentsRectForScaling):
+ * UIProcess/qt/QtViewportInteractionEngine.cpp:
+ (WebKit::ViewportUpdateDeferrer::~ViewportUpdateDeferrer):
+ (WebKit::QtViewportInteractionEngine::flickableMovingPositionUpdate):
+ (WebKit::QtViewportInteractionEngine::wheelEvent):
+ (WebKit::QtViewportInteractionEngine::pinchGestureStarted):
+ * UIProcess/qt/QtViewportInteractionEngine.h:
+ (QtViewportInteractionEngine):
+ * WebProcess/WebPage/LayerTreeHost.h:
+ (WebKit::LayerTreeHost::setVisibleContentsRectForScaling):
+ (WebKit::LayerTreeHost::setVisibleContentsRectForPanning):
+ (WebKit::LayerTreeHost::setVisibleContentsRectForLayer):
+ * WebProcess/WebPage/LayerTreeHost.messages.in:
+ * WebProcess/WebPage/qt/LayerTreeHostQt.cpp:
+ (WebKit::LayerTreeHostQt::setVisibleContentsRectForScaling):
+ (WebKit::LayerTreeHostQt::setVisibleContentsRectForPanning):
+ * WebProcess/WebPage/qt/LayerTreeHostQt.h:
+ (LayerTreeHostQt):
+
+2012-02-24 Sergio Villar Senin <svillar@igalia.com>
+
+ [WK2] [GTK] Destructor not invoked in EditorClientFrameDestructionObserver
+ https://bugs.webkit.org/show_bug.cgi?id=79466
+
+ Reviewed by Philippe Normand.
+
+ Explicitly cast the observer before deleting it instead of just
+ deleting a generic pointer. We must to that in order to get the
+ destructor of the object properly called.
+
+ * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
+ (WebKit::EditorClientFrameDestructionObserver::destroyOnClosureFinalization):
+
+2012-02-23 Andy Estes <aestes@apple.com>
+
+ Rename [setS|s]uppressIncrementalRendering to [setS|s]uppressesIncrementalRendering and make it WebPreferences API.
+ https://bugs.webkit.org/show_bug.cgi?id=79433
+
+ Reviewed by Dan Bernstein.
+
+ * Shared/WebPreferencesStore.h:
+ (WebKit):
+ * UIProcess/API/C/WKPreferences.cpp:
+ (WKPreferencesSetSuppressesIncrementalRendering):
+ (WKPreferencesGetSuppressesIncrementalRendering):
+ * UIProcess/API/C/WKPreferences.h:
+ * UIProcess/WebInspectorProxy.cpp:
+ (WebKit::createInspectorPageGroup):
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::dispatchDidFirstLayout):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::updatePreferences):
+
+2012-02-23 Mario Sanchez Prada <msanchez@igalia.com>
+
+ [GTK] Wrong signal name on emission in WebKitWindowProperties.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=79352
+
+ Reviewed by Philippe Normand.
+
+ Emit the signal 'resizable' instead of 'resizable-visible'.
+
+ * UIProcess/API/gtk/WebKitWindowProperties.cpp:
+ (webkitWindowPropertiesSetResizable): Use right signal name.
+
+2012-02-23 Anders Carlsson <andersca@apple.com>
+
+ Flush layer changes after layout when resizing web page
+ https://bugs.webkit.org/show_bug.cgi?id=79399
+ <rdar://problem/10920157>
+
+ Reviewed by Andreas Kling.
+
+ Flush layer changes after layout, otherwise the scrollbars won't be updated
+ until sometime later which looks bad.
+
+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+ (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
+
+2012-02-23 Daniel Bates <dbates@webkit.org>
+
+ Add missing "Reviewed by" line to change log entry for changeset r108631
+ (https://bugs.webkit.org/show_bug.cgi?id=79252)
+
+ The patch landed in changeset r108631 was reviewed by Martin Robinson.
+
+ * ChangeLog:
+
+2012-02-23 Patrick Gansterer <paroga@webkit.org>
+
+ [CMake] Add WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS macro
+ https://bugs.webkit.org/show_bug.cgi?id=79371
+
+ Reviewed by Daniel Bates.
+
+ * CMakeLists.txt:
+
+2012-02-23 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt] Add support for touch cancellation
+ https://bugs.webkit.org/show_bug.cgi?id=79348
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Convert and forward incoming touch cancellation events
+ to the web process.
+
+ * Shared/qt/WebEventFactoryQt.cpp:
+ (WebKit::webEventTypeForEvent):
+ (WebKit::WebEventFactory::createWebTouchEvent):
+ * UIProcess/API/qt/qquickwebview.cpp:
+ (QQuickWebView::event):
+ * UIProcess/qt/QtWebPageEventHandler.cpp:
+ (QtWebPageEventHandler::handleEvent):
+
+2012-02-23 Brent Fulgham <bfulgham@webkit.org>
+
+ [WinCairo] Build fix after r108428.
+
+ * win/WebKit2CFLite.def: Add missing export declaration.
+
+2012-02-23 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Unreviewed test fix after r108614: Adjust public API after changes.
+
+ * UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp:
+
+2012-02-23 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt] Build fix. Qt WebKit2 can not be compiled due to QtWebPageEventHandler.
+ https://bugs.webkit.org/show_bug.cgi?id=79335
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ In the upcoming Qt 5 builds the convenient setInputMethodHints method on QQuickItem
+ will be removed. There's no need for us to use it, we can implement passing the hints
+ to the input method right away in our re-implementation of inputMethodQuery, which works
+ with old and newer Qt 5 builds.
+
+ * UIProcess/API/qt/qquickwebview.cpp:
+ (QQuickWebView::inputMethodQuery):
+ * UIProcess/qt/QtWebPageEventHandler.cpp:
+ (QtWebPageEventHandler::updateTextInputState):
+
+2012-02-23 Sergio Villar Senin <svillar@igalia.com>
+
+ [WK2][GTK] WebProcess SIGSEVs due to incorrect clipboard handling
+ https://bugs.webkit.org/show_bug.cgi?id=79252
+
+ Reviewed by Martin Robinson.
+
+ Do not execute clipboard callbacks after the Frame associated with
+ it is destroyed.
+
+ This change is already covered by the TestWebViewEditor unit tests
+ (among others), they hang (because WebProcess dies) without this
+ patch in Debug builds.
+
+ * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
+ (EditorClientFrameDestructionObserver):
+ (WebKit::EditorClientFrameDestructionObserver::EditorClientFrameDestructionObserver):
+ (WebKit::EditorClientFrameDestructionObserver::frameDestroyed):
+ (WebKit::EditorClientFrameDestructionObserver::destroyOnClosureFinalization):
+ (WebKit):
+ (WebKit::WebEditorClient::setSelectionPrimaryClipboardIfNeeded):
+
+2012-02-23 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ [Qt] Page doesn't get repainted while panning is in progress
+ https://bugs.webkit.org/show_bug.cgi?id=78602
+
+ Reviewed by Simon Hausmann.
+
+ The tiling code needed the current visibleContentsRect in order to be
+ able to create tiles, so we now make sure it gets it. We also needed
+ to make sure to set the trajectory vector while panning and while the
+ flicking engine was animating kinetic scrolling.
+
+ * UIProcess/API/qt/qquickwebview.cpp:
+ (QQuickWebViewFlickablePrivate::_q_updateVisibleContentRectAndScale):
+ (QQuickWebViewPrivate::_q_viewportTrajectoryVectorChanged):
+ * UIProcess/DrawingAreaProxy.h:
+ (WebKit::DrawingAreaProxy::setVisibleContentRectTrajectoryVector):
+ * UIProcess/DrawingAreaProxyImpl.cpp:
+ (WebKit::DrawingAreaProxyImpl::setVisibleContentRectTrajectoryVector):
+ * UIProcess/DrawingAreaProxyImpl.h:
+ (DrawingAreaProxyImpl):
+ * UIProcess/LayerTreeHostProxy.h:
+ (LayerTreeHostProxy):
+ * UIProcess/qt/LayerTreeHostProxyQt.cpp:
+ (WebKit::LayerTreeHostProxy::setVisibleContentRectTrajectoryVector):
+ * UIProcess/qt/QtViewportInteractionEngine.cpp:
+ (WebKit::QtViewportInteractionEngine::QtViewportInteractionEngine):
+ (WebKit::QtViewportInteractionEngine::flickableMovingStateChanged):
+ (WebKit):
+ (WebKit::QtViewportInteractionEngine::panMoveStarted):
+ (WebKit::QtViewportInteractionEngine::panMoveEnded):
+ (WebKit::QtViewportInteractionEngine::flickableMovingPositionUpdate):
+ (WebKit::QtViewportInteractionEngine::panGestureRequestUpdate):
+ * UIProcess/qt/QtViewportInteractionEngine.h:
+ (QtViewportInteractionEngine):
+ * WebProcess/WebPage/LayerTreeHost.h:
+ (WebKit::LayerTreeHost::setVisibleContentRectTrajectoryVector):
+ * WebProcess/WebPage/LayerTreeHost.messages.in:
+ * WebProcess/WebPage/qt/LayerTreeHostQt.cpp:
+ (WebKit::LayerTreeHostQt::setVisibleContentRectAndScale):
+ (WebKit::LayerTreeHostQt::setVisibleContentRectTrajectoryVector):
+ * WebProcess/WebPage/qt/LayerTreeHostQt.h:
+ (LayerTreeHostQt):
+
+2012-02-23 Patrick Gansterer <paroga@webkit.org>
+
+ [CMAKE][WK2] Cleanup WebKit2/CMakeLists.txt.
+ https://bugs.webkit.org/show_bug.cgi?id=76122
+
+ Reviewed by Eric Seidel.
+
+ * CMakeLists.txt: Removed hardcoded WTF_USE_JSC preprocessor definition.
+
+2012-02-23 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [WK2] Trivial build fix after r108615.
+
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::WebPage):
+
+2012-02-22 Michael Tyutyunik <michael.tyutyunik@nokia.com>
+
+ [Qt][WK2] navigationType is missing in new API
+ https://bugs.webkit.org/show_bug.cgi?id=78867
+
+ Reviewed by Simon Hausmann.
+
+ In QtWebPagePolicyClient::decidePolicyForNavigationAction()
+ navigationType argument is dropped by mistake. Adding it back
+ and make it available through NavigationRequest.
+
+ * UIProcess/API/qt/qquickwebview_p.h:
+ * UIProcess/API/qt/qwebnavigationrequest.cpp:
+ (QWebNavigationRequestPrivate::QWebNavigationRequestPrivate):
+ (QWebNavigationRequestPrivate):
+ (QWebNavigationRequest::QWebNavigationRequest):
+ (QWebNavigationRequest::navigationType):
+ * UIProcess/API/qt/qwebnavigationrequest_p.h:
+ * UIProcess/qt/QtWebPagePolicyClient.cpp:
+ (QtWebPagePolicyClient::decidePolicyForNavigationAction):
+ (toQuickWebViewNavigationType):
+ * UIProcess/qt/QtWebPagePolicyClient.h:
+ (QtWebPagePolicyClient):
+
+2012-02-22 Anders Carlsson <andersca@apple.com>
+
+ Implement TiledCoreAnimationDrawingAreaProxy::deviceScaleFactorDidChange
+ https://bugs.webkit.org/show_bug.cgi?id=79297
+ <rdar://problem/10748510>
+
+ Reviewed by Beth Dakin.
+
+ * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
+ (WebKit::TiledCoreAnimationDrawingAreaProxy::deviceScaleFactorDidChange):
+ Send a message to the web process.
+
+ * WebProcess/WebPage/DrawingArea.h:
+ (WebKit::DrawingArea::setDeviceScaleFactor):
+ Add empty stub.
+
+ * WebProcess/WebPage/DrawingArea.messages.in:
+ Add SetDeviceScaleFactor message.
+
+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+ (WebKit::TiledCoreAnimationDrawingArea::setDeviceScaleFactor):
+ Call WebPage::setDeviceScaleFactor.
+
+2012-02-22 Brady Eidson <beidson@apple.com>
+
+ <rdar://problem/10406044> and https://bugs.webkit.org/show_bug.cgi?id=79279
+ Synchronous ShouldGoToBackForwardListItem causes lots of WebProcess hangs
+
+ Reviewed by Anders Carlsson.
+
+ Anytime the WebProcess sends a sync message up to the UI Process a hang can ensue.
+
+ In the case of shouldGoToBackForwardListItem it seems many clients want a back/forward
+ notification but don't actually want to make a policy decision.
+
+ Making it an asynchronous notification instead of a synchronous policy call will remove the
+ possibility of a hang here.
+
+ If clients later decide it is important to have a policy here we should implement a form of
+ shouldGoToBackForwardListItem in the bundle loader client.
+
+ Add a notification "willGoToBackForwardListItem" to the WKPageLoaderClient:
+ * UIProcess/API/C/WKPage.h:
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::initializeLoaderClient): Tell the WebProcess whether it should be
+ sending the shouldGoToBackForwardListItem or willGoToBackForwardListItem form of this message.
+ (WebKit::WebPageProxy::shouldGoToBackForwardListItem):
+ (WebKit::WebPageProxy::willGoToBackForwardListItem):
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/WebPageProxy.messages.in: Add an asynchronous WillGoToBackForwardListItem message
+
+ Store a flag in the WebProcess - Sent from the UIProcess - to tell the FrameLoaderClient which form
+ of the callback should be used:
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::WebPage):
+ * WebProcess/WebPage/WebPage.h:
+ (WebKit::WebPage::willGoToBackForwardItemCallbackEnabled):
+ (WebKit::WebPage::setWillGoToBackForwardItemCallbackEnabled):
+ * WebProcess/WebPage/WebPage.messages.in:
+
+ * UIProcess/WebLoaderClient.cpp:
+ (WebKit::WebLoaderClient::shouldGoToBackForwardListItem): Only consider calling this for
+ version 0 clients.
+ (WebKit::WebLoaderClient::willGoToBackForwardListItem): Later clients get this callback.
+ * UIProcess/WebLoaderClient.h:
+ (WebLoaderClient):
+
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::shouldGoToHistoryItem): Send either the synchronous "should" message
+ or the asynchronous "will" message depending on which the WebProcess was last told that the
+ UIProcess expects. There is an edge case where the wrong one might be sent because the WebProcess
+ hasn't received the message about a change in the WKPageLoaderClient yet but that's probably okay;
+ It seems unlikely that a UIProcess client would ever rapidly change between v0 and other versions
+ of the loader client and the UIProcess of WebKit2 is equipped to handle that case if it comes up.
+
+2012-02-16 Jon Lee <jonlee@apple.com>
+
+ [WK2] Clearing notifications does not clean up internal state
+ https://bugs.webkit.org/show_bug.cgi?id=78861
+ <rdar://problem/10881167>
+
+ Reviewed by Anders Carlsson.
+
+ * WebProcess/Notifications/WebNotificationManager.cpp:
+ (WebKit::WebNotificationManager::clearNotifications): This function was missing removing the notification
+ entries from the other maps.
+ (WebKit::WebNotificationManager::didDestroyNotification): When the notification is destroyed, it should
+ also be removed from the context map.
+ (WebKit::WebNotificationManager::didCloseNotifications): Refactor to pull out the code that removes
+ a provided notification from the context map.
+ (WebKit::WebNotificationManager::removeNotificationFromContextMap): Find the notification in the map, and
+ remove it. If the map is empty, get rid of the entry.
+ * WebProcess/Notifications/WebNotificationManager.h:
+ (WebNotificationManager):
+
+2012-02-22 Jon Lee <jonlee@apple.com>
+
+ Code cleanup in WebNotificationManager (79285)
+ https://bugs.webkit.org/show_bug.cgi?id=79285
+ <rdar://problem/10914522>
+
+ Reviewed by Anders Carlsson.
+
+ * WebProcess/Notifications/WebNotificationManager.cpp:
+ (WebKit::WebNotificationManager::show): Simplify adding a blank vector to the map using .add(),
+ similar to what is found in WebNotificationClient.mm in WebKit 1.
+
+2012-02-21 Ryosuke Niwa <rniwa@webkit.org>
+
+ Remove the remaining uses of CSSStyleDeclaration in Editor
+ https://bugs.webkit.org/show_bug.cgi?id=78939
+
+ Reviewed by Enrica Casucci.
+
+ * WebProcess/WebCoreSupport/WebEditorClient.cpp:
+ (WebKit::WebEditorClient::shouldApplyStyle):
+ * WebProcess/WebCoreSupport/WebEditorClient.h:
+ (WebEditorClient):
+
+2012-02-22 Martin Robinson <mrobinson@igalia.com>
+
+ [GTK] Clean build is broken when using make -j
+ https://bugs.webkit.org/show_bug.cgi?id=76388
+
+ * GNUmakefile.am: Add some WebKit2 sources to global sources lists
+ so that we can refer to them in separate GNUmakefiles.
+
+2012-02-22 Antaryami Pandia <antaryami.pandia@motorola.com>
+
+ [GTK][WK2] Add WebGL WebSetting.
+ https://bugs.webkit.org/show_bug.cgi?id=79217
+
+ Reviewed by Martin Robinson.
+
+ Add a WebSetting to enable/disable Webgl.
+
+ * UIProcess/API/gtk/WebKitSettings.cpp:
+ (webKitSettingsSetProperty):
+ (webKitSettingsGetProperty):
+ (webkit_settings_class_init):
+ (webkit_settings_set_enable_webaudio):
+ (webkit_settings_get_enable_webgl):
+ (webkit_settings_set_enable_webgl):
+ * UIProcess/API/gtk/WebKitSettings.h:
+ * UIProcess/API/gtk/docs/webkit2gtk-sections.txt:
+ * UIProcess/API/gtk/tests/TestWebKitSettings.cpp:
+ (testWebKitSettings):
+
+2012-02-22 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ [Qt] Disregard previous backing store as soon as possible
+ https://bugs.webkit.org/show_bug.cgi?id=79232
+
+ Reviewed by Simon Hausmann and No'am Rosenthal.
+
+ Between creating the new backing store and painting the content,
+ we do not want to drop the previous one as that might result in
+ briefly seeing flickering as the old tiles may be dropped before
+ something replaces them.
+
+ But we do need to drop it at some point and we need to make sure
+ to not spike the memory usage before of this.
+
+ What we now do, is to store the previous backing store as before,
+ but drop all tiles which are not visible and then drop it as soon
+ as the visible rect (which might change due if followed by a quick
+ panning) has been fully covered by tiles.
+
+ * WebProcess/WebCoreSupport/WebGraphicsLayer.cpp:
+ (WebCore::WebGraphicsLayer::setContentsScale):
+ (WebCore::WebGraphicsLayer::updateContentBuffers):
+
+2012-02-22 Michael Brüning <michael.bruning@nokia.com>
+
+ [Qt][WK2] Implement proxy authentication handling.
+ https://bugs.webkit.org/show_bug.cgi?id=78792
+
+ Reviewed by Simon Hausmann.
+
+ This patch corrects two bugs with the previous implementation:
+ 1. The signal proxyAuthenticationRequired was not connected to a
+ slot.
+ 2. The slot onProxyAuthenticationRequired had the wrong parameters.
+
+ * WebProcess/qt/QtNetworkAccessManager.cpp:
+ (WebKit::QtNetworkAccessManager::QtNetworkAccessManager):
+ (WebKit::QtNetworkAccessManager::onProxyAuthenticationRequired):
+ * WebProcess/qt/QtNetworkAccessManager.h: Added include.
+ (QtNetworkAccessManager):
+
+2012-02-22 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Merge setVisibleRectTrajectoryVector and adjustVisibleRect to
+ the more descriptive coverWithTilesIfNeeded
+ https://bugs.webkit.org/show_bug.cgi?id=79230
+
+ Reviewed by Simon Hausmann.
+
+ Replace use by coverWithTilesIfNeeded().
+
+ * WebProcess/WebCoreSupport/WebGraphicsLayer.cpp:
+ (WebCore::WebGraphicsLayer::setVisibleContentRectTrajectoryVector):
+ (WebCore::WebGraphicsLayer::adjustVisibleRect):
+ (WebCore::WebGraphicsLayer::computeTransformedVisibleRect):
+
+2012-02-22 Zalan Bujtas <zbujtas@gmail.com>
+
+ [Qt][WK2] Add frame flattening setting to QWebPreferences.
+ https://bugs.webkit.org/show_bug.cgi?id=79099
+
+ Reviewed by Simon Hausmann.
+
+ Frame flattening is enabled by default for Qt WebKit2.
+
+ * UIProcess/API/qt/qquickwebview.cpp:
+ (QQuickWebViewPrivate::initialize):
+ * UIProcess/API/qt/qwebpreferences.cpp:
+ (QWebPreferencesPrivate::testAttribute):
+ (QWebPreferencesPrivate::setAttribute):
+ (QWebPreferences::setNavigatorQtObjectEnabled):
+ (QWebPreferences::frameFlatteningEnabled):
+ (QWebPreferences::setFrameFlatteningEnabled):
+ * UIProcess/API/qt/qwebpreferences_p.h:
+
+2012-02-22 Ryosuke Niwa <rniwa@webkit.org>
+
+ Remove the remaining uses of CSSStyleDeclaration in Editor
+ https://bugs.webkit.org/show_bug.cgi?id=78939
+
+ Reviewed by Enrica Casucci.
+
+ * WebProcess/WebCoreSupport/WebEditorClient.cpp:
+ (WebKit::WebEditorClient::shouldApplyStyle):
+ * WebProcess/WebCoreSupport/WebEditorClient.h:
+ (WebEditorClient):
+
+2012-02-21 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Null ResourceErrors are encoded/decoded as empty ResourceErrors
+ https://bugs.webkit.org/show_bug.cgi?id=79120
+
+ Reviewed by Martin Robinson.
+
+ * Shared/gtk/WebCoreArgumentCodersGtk.cpp:
+ (CoreIPC::::encode): Encode a boolean to indicate whether it's a
+ Null error.
+ (CoreIPC::::decode): Check whether the error is Null and do not
+ continue decoding in such case.
+
+2012-02-21 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ [Qt][WK2] Draw tiles of previous contents-scale for opaque layers if they don't intersect with previous tiles
+ https://bugs.webkit.org/show_bug.cgi?id=78962
+
+ Only avoid painting old-scale tiles in semi-transparent situtations if the old
+ tiles intersect with existing tiles.
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * UIProcess/qt/LayerBackingStore.cpp:
+ (WebKit::LayerBackingStore::paintToTextureMapper):
+
+2012-02-21 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ [Qt] Previous web page appears outside content rect
+ https://bugs.webkit.org/show_bug.cgi?id=78816
+
+ Apply a clip on painted tiles if some of the tiles fall outside of the target rect.
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * UIProcess/qt/LayerBackingStore.cpp:
+ (WebKit::LayerBackingStore::paintToTextureMapper):
+
+2012-02-21 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ [Qt][WK2] Accelerated animations don't work on Mac
+ https://bugs.webkit.org/show_bug.cgi?id=78963
+
+ Problem came from using a non-RunLoop timer.
+ Remove the unused viewportUpdateTimer, and use the existing animationTimer instead.
+ Use a continuous timer that we only stop when animations stop.
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * UIProcess/LayerTreeHostProxy.h:
+ (LayerTreeHostProxy):
+ * UIProcess/qt/LayerTreeHostProxyQt.cpp:
+ (WebKit::LayerTreeHostProxy::LayerTreeHostProxy):
+ (WebKit::LayerTreeHostProxy::paintToCurrentGLContext):
+ (WebKit):
+ (WebKit::LayerTreeHostProxy::syncAnimations):
+
+2012-02-21 Sam Weinig <sam@webkit.org>
+
+ Attempt to fix the Snow Leopard build.
+
+ * Configurations/Base.xcconfig:
+
+2012-02-21 Sam Weinig <sam@webkit.org>
+
+ Use libc++ when building with Clang on Mac
+ https://bugs.webkit.org/show_bug.cgi?id=78981
+
+ Reviewed by Dan Bernstein.
+
+ * Configurations/Base.xcconfig:
+
+2012-02-21 Andras Becsi <andras.becsi@nokia.com>
+
+ [Qt][WK2] Get rid of the dependency to QtWidgets
+ https://bugs.webkit.org/show_bug.cgi?id=76276
+
+ Reviewed by Simon Hausmann.
+
+ * Target.pri:
+ * UIProcess/API/qt/tests/qmltests/tst_qmltests.cpp:
+ (main):
+ * UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp:
+ * UIProcess/API/qt/tests/tests.pri:
+ * UIProcess/API/qt/tests/util.h:
+
+2012-02-20 Martin Robinson <mrobinson@igalia.com>
+
+ [UNIX] Plugin information fields are not interpreted as UTF-8
+ https://bugs.webkit.org/show_bug.cgi?id=78635
+
+ Reviewed by Gustavo Noronha Silva.
+
+ Interpret plugin metadata as UTF8 aways. This matches the behavior
+ of Chromium and the Totem plugin.
+
+ * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
+ (WebKit::NetscapePluginModule::getPluginInfoForLoadedPlugin): Use String::fromUTF8.
+
+2012-02-20 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Adding SOUP_TYPE_PROXY_RESOLVER_DEFAULT feature to soup session makes WebProcess to hang
+ https://bugs.webkit.org/show_bug.cgi?id=79036
+
+ Reviewed by Martin Robinson.
+
+ This looks like a bug in gobject. Initializing the WebProcess
+ before creating the soup session seems to fix the problem. It's
+ actually a workaround, but initializing the WebProcess as sson as
+ possible it's a good idea in any case.
+
+ * WebProcess/gtk/WebProcessMainGtk.cpp:
+ (WebKit::WebProcessMainGtk):
+
+2012-02-20 Michael Brüning <michael.bruning@nokia.com>
+
+ [Qt][WK2] Implement proxy authentication handling.
+ https://bugs.webkit.org/show_bug.cgi?id=78792
+
+ Reviewed by Simon Hausmann.
+
+ This patch implements the proxy authentication handling
+ for the Qt port in a similar matter to the http authentication
+ implementation.
+
+ Since there is a need to pass the proxy port, which is of type uint16_t,
+ from the WebProcess to the UIProcess, an encoder and a decoder for
+ this type was added because it did not exist.
+
+ The message that was added to the WebPageProxy is called synchronously
+ as this is needed by the implementation of the network access manager
+ and has also been implemented this way already for the http
+ authentication.
+
+ * Platform/CoreIPC/ArgumentDecoder.cpp:
+ (CoreIPC::ArgumentDecoder::decodeUInt16):
+ (CoreIPC):
+ * Platform/CoreIPC/ArgumentDecoder.h:
+ (ArgumentDecoder):
+ (CoreIPC::ArgumentDecoder::decode):
+ (CoreIPC):
+ * Platform/CoreIPC/ArgumentEncoder.cpp:
+ (CoreIPC::ArgumentEncoder::encodeUInt16):
+ (CoreIPC):
+ * Platform/CoreIPC/ArgumentEncoder.h:
+ (ArgumentEncoder):
+ (CoreIPC::ArgumentEncoder::encode):
+ (CoreIPC):
+ * UIProcess/API/qt/qquickwebview.cpp:
+ (QQuickWebViewPrivate::QQuickWebViewPrivate):
+ (QQuickWebViewPrivate::handleProxyAuthenticationRequiredRequest):
+ (QQuickWebViewExperimental::proxyAuthenticationDialog):
+ (QQuickWebViewExperimental::setProxyAuthenticationDialog):
+ * UIProcess/API/qt/qquickwebview_p.h:
+ * UIProcess/API/qt/qquickwebview_p_p.h:
+ (QQuickWebViewPrivate):
+ * UIProcess/PageClient.h:
+ (PageClient):
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::proxyAuthenticationRequiredRequest):
+ (WebKit):
+ * UIProcess/WebPageProxy.h:
+ (WebPageProxy):
+ * UIProcess/WebPageProxy.messages.in:
+ * UIProcess/qt/QtDialogRunner.cpp:
+ (ProxyAuthenticationDialogContextObject):
+ (ProxyAuthenticationDialogContextObject::ProxyAuthenticationDialogContextObject):
+ (ProxyAuthenticationDialogContextObject::hostname):
+ (ProxyAuthenticationDialogContextObject::port):
+ (ProxyAuthenticationDialogContextObject::prefilledUsername):
+ (ProxyAuthenticationDialogContextObject::accept):
+ (ProxyAuthenticationDialogContextObject::reject):
+ (QtDialogRunner::initForProxyAuthentication):
+ * UIProcess/qt/QtDialogRunner.h:
+ (QtDialogRunner):
+ * UIProcess/qt/QtPageClient.cpp:
+ (QtPageClient::handleProxyAuthenticationRequiredRequest):
+ * UIProcess/qt/QtPageClient.h:
+ (QtPageClient):
+ * WebProcess/WebPage/DecoderAdapter.cpp:
+ (WebKit::DecoderAdapter::decodeUInt16):
+ (WebKit):
+ * WebProcess/WebPage/DecoderAdapter.h:
+ (DecoderAdapter):
+ * WebProcess/WebPage/EncoderAdapter.cpp:
+ (WebKit::EncoderAdapter::encodeUInt16):
+ (WebKit):
+ * WebProcess/WebPage/EncoderAdapter.h:
+ (EncoderAdapter):
+ * WebProcess/qt/QtNetworkAccessManager.cpp:
+ (WebKit::QtNetworkAccessManager::onProxyAuthenticationRequired):
+ (WebKit):
+ * WebProcess/qt/QtNetworkAccessManager.h:
+ (QtNetworkAccessManager):
+
+2012-02-20 Patrick Gansterer <paroga@webkit.org>
+
+ [CMake] Update and sort list of source files.
+
+ * CMakeLists.txt:
+
+2012-02-20 Martin Robinson <mrobinson@igalia.com>
+
+ Fix WebKit2GTK+ for 'make distcheck'.
+
+ Instead of conditionally including WebKit2 GNUmakefiles, always
+ include them and conditionally activate the final targets.
+
+ * GNUmakefile.am:
+ * UIProcess/API/gtk/tests/GNUmakefile.am:
+
+2012-02-20 Martin Robinson <mrobinson@igalia.com>
+
+ [GTK][WK2] WebKit2 does not build if gtk-unix-printing-3.0 is not available
+ https://bugs.webkit.org/show_bug.cgi?id=79011
+
+ Fix the build when gtk-unix-printing-3.0 is not present.
+
+ * UIProcess/API/gtk/WebKitPrintOperation.cpp:
+ (webkitPrintOperationRunDialog):
+ (webkitPrintOperationRunDialogForFrame):
+ * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
+ (WebKit::WebPrintOperationGtk::create):
+
+2012-02-18 Dan Bernstein <mitz@apple.com>
+
+ <rdar://problem/10891801> BackingStore::scroll() unnecessarily copies pixels around
+ https://bugs.webkit.org/show_bug.cgi?id=78976
+
+ Reviewed by Anders Carlsson.
+
+ Rather than move pixels in the backing store in response to scrolling, we can maintain a
+ mapping, for the most recently scrolled rect, from backing store coordinates to view
+ client coordinates.
+
+ * UIProcess/BackingStore.h:
+ * UIProcess/mac/BackingStoreMac.mm:
+ (WebKit::BackingStore::performWithScrolledRectTransform): Added. Given a block to be
+ performed on a rect, divides the rect into parts such that for each part the mapping from
+ backing store coordinates to client coordinates is a (uniform) translation, and performs
+ the block on that part, passing it the translation that applies to the part.
+ (WebKit::BackingStore::resetScrolledRect): Added. Copies everything in the scrolled rect
+ back to where it should be under the identity map, and resets the scrolled rect and offset.
+ (WebKit::BackingStore::paint): Changed to call through performWithScrolledRectTransform().
+ (WebKit::BackingStore::incorporateUpdate): Ditto.
+ (WebKit::BackingStore::scroll): Now instead of copying pixels, just updates the scrolled
+ rect and offset.
+
+2012-02-17 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ [Qt][WK2] Allow opaque tiles
+ https://bugs.webkit.org/show_bug.cgi?id=78809
+
+ Apply the SupportsAlpha flag only when the buffers actually have alpha.
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * Shared/ShareableBitmap.h:
+ (ShareableBitmap):
+ * Shared/qt/ShareableBitmapQt.cpp:
+ * UIProcess/qt/LayerBackingStore.cpp:
+ (WebKit::LayerBackingStoreTile::swapBuffers):
+
+2012-02-17 Adam Roben <aroben@apple.com>
+
+ Clang build fix after r108119
+
+ * WebProcess/WebProcess.cpp:
+ (WebKit::randomCrashThread): Annotate this function with NO_RETURN_DUE_TO_CRASH.
+
+2012-02-17 Kalev Lember <kalevlember@gmail.com>
+
+ Remove unused parameters from WTF threading API
+ https://bugs.webkit.org/show_bug.cgi?id=78389
+
+ Reviewed by Adam Roben.
+
+ waitForThreadCompletion() had an out param 'void **result' to get the
+ 'void *' returned by ThreadFunction. However, the implementation in
+ ThreadingWin.cpp ignored the out param, not filling it in. This had
+ led to a situation where none of the client code made use of the param
+ and just ignored it.
+
+ To clean this up, the patch changes the signature of ThreadFunction to
+ return void instead of void* and drops the the unused 'void **result'
+ parameter from waitForThreadCompletion. Also, all client code is
+ updated for the API change.
+
+ As mentioned in https://bugs.webkit.org/show_bug.cgi?id=78389 , even
+ though the change only affects internal API, Safari is using it
+ directly and we'll need to keep the old versions around for ABI
+ compatibility. For this, the patch adds compatibility wrappers with
+ the old ABI.
+
+ * Platform/WorkQueue.h:
+ (WorkQueue):
+ * Platform/gtk/WorkQueueGtk.cpp:
+ (WorkQueue::startWorkQueueThread):
+ * UIProcess/Launcher/mac/ThreadLauncherMac.mm:
+ (WebKit::webThreadBody):
+ * UIProcess/Launcher/qt/ThreadLauncherQt.cpp:
+ (WebKit::webThreadBody):
+ * UIProcess/Launcher/win/ThreadLauncherWin.cpp:
+ (WebKit::webThreadBody):
+ * WebProcess/WebProcess.cpp:
+ (WebKit::randomCrashThread):
+ * win/WebKit2.def:
+ * win/WebKit2CFLite.def:
+
+2012-02-17 Mihnea Ovidenie <mihnea@adobe.com>
+
+ CSS regions enabled by default
+ https://bugs.webkit.org/show_bug.cgi?id=78525
+
+ Reviewed by David Hyatt.
+
+ Add a runtime preference to enable/disable regions functionality at runtime(WebKitCSSRegionsEnabled).
+ CSSRegions are still enabled by default.
+ In DRT, use layoutTestController.overridePreference("WebKitCSSRegionsEnabled", "0") to disable the css regions functionality.
+
+ * Shared/WebPreferencesStore.h:
+ (WebKit):
+ * UIProcess/API/C/WKPreferences.cpp:
+ (WKPreferencesSetCSSRegionsEnabled):
+ (WKPreferencesGetCSSRegionsEnabled):
+ * UIProcess/API/C/WKPreferencesPrivate.h:
+ * WebProcess/InjectedBundle/InjectedBundle.cpp:
+ (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::updatePreferences):
+
+2012-02-17 Enrica Casucci <enrica@apple.com>
+
+ Refactor DragData class to use PlatformStrategies in the Mac implementation.
+ https://bugs.webkit.org/show_bug.cgi?id=78768
+
+ Reviewed by Darin Adler.
+
+ * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: Added color() method.
+ (WebKit::WebPlatformStrategies::color):
+ * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
+
+2012-02-17 Martin Robinson <mrobinson@igalia.com>
+
+ Fix some warnings encountered during the GTK+ build
+ https://bugs.webkit.org/show_bug.cgi?id=78911
+
+ Reviewed by Xan Lopez.
+
+ * UIProcess/API/gtk/WebKitLoaderClient.cpp:
+ (attachLoaderClientToView): Initialize a new member of the loader client struct.
+
+2012-02-17 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Allow printing scaled pages in WebKit2 for printers that don't support it
+ https://bugs.webkit.org/show_bug.cgi?id=78823
+
+ Reviewed by Gustavo Noronha Silva.
+
+ * UIProcess/API/gtk/WebKitPrintOperation.cpp:
+ (webkitPrintOperationRunDialogUnix): Enable scale option in print
+ dialog.
+ * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
+ (WebKit::WebPrintOperationGtk::WebPrintOperationGtk): Initialize
+ manual scale to 1.
+ (WebKit::WebPrintOperationGtk::rotatePageIfNeeded): Renamed and
+ moved the needs rotate check here as an early return.
+ (WebKit::WebPrintOperationGtk::prepareContextToDraw): Scale the
+ page according to the manual scale factor.
+ (WebKit::WebPrintOperationGtk::renderPage): Move rotatePage to
+ prepareContextToDraw.
+ * WebProcess/WebPage/gtk/WebPrintOperationGtk.h:
+
+2012-02-17 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Allow printing multiple copies in WebKit2 for printers that don't support it
+ https://bugs.webkit.org/show_bug.cgi?id=78805
+
+ Reviewed by Gustavo Noronha Silva.
+
+ * UIProcess/API/gtk/WebKitPrintOperation.cpp:
+ (webkitPrintOperationRunDialogUnix): Enable multiple copies and
+ collate options in print dialog.
+ * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
+ (WebKit::PrintPagesData::PrintPagesData): Initialize number of
+ collated and uncolated copies done and total.
+ (WebKit::PrintPagesData::collatedCopiesLeft): Helper function that
+ returns the number of collated copies left to do.
+ (WebKit::PrintPagesData::uncollatedCopiesLeft): Helper function
+ that returns the number of uncollated copies left to do.
+ (WebKit::PrintPagesData::copiesLeft): Helper function
+ that returns the number of collated or uncollated copies left to
+ do.
+ (WebKit::PrintPagesData::incrementPageSequence): Do not finish the
+ print if there are uncollated copies left, and do not increment
+ sheet number if there are collated copies left.
+ (WebKit::WebPrintOperationGtk::WebPrintOperationGtk): Initialize
+ m_manualCopies to 1 and m_manualCollateCopies to false.
+ * WebProcess/WebPage/gtk/WebPrintOperationGtk.h:
+
+2012-02-17 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Allow printing pages in reverse order in WebKit2 for printers that don't support it
+ https://bugs.webkit.org/show_bug.cgi?id=78799
+
+ Reviewed by Gustavo Noronha Silva.
+
+ * UIProcess/API/gtk/WebKitPrintOperation.cpp:
+ (webkitPrintOperationRunDialogUnix): Enable printing in reverse
+ order option in print dialog.
+ * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
+ (WebKit::PrintPagesData::PrintPagesData): Initialize sheetNumber
+ and lastPagePosition depending on whether printing is in reverse
+ order or not.
+ (WebKit::PrintPagesData::incrementPageSequence): Use a negative
+ increment step when printing in reverse order. Fix page
+ incrementing when printing only odd/even pages broken in previous
+ commit due to merge conflicts.
+ (WebKit::WebPrintOperationGtk::WebPrintOperationGtk): Initialize
+ reverse printing to false.
+ * WebProcess/WebPage/gtk/WebPrintOperationGtk.h:
+
+2012-02-17 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Allow printing only odd/even pages in WebKit2 for printers that don't support it
+ https://bugs.webkit.org/show_bug.cgi?id=78793
+
+ Reviewed by Gustavo Noronha Silva.
+
+ * UIProcess/API/gtk/WebKitPrintOperation.cpp:
+ (webkitPrintOperationRunDialogUnix): Enable print odd/even pages
+ option in print dialog.
+ * WebProcess/WebPage/gtk/WebPrintOperationGtk.h:
+ * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
+ (WebKit::PrintPagesData::PrintPagesData): Add lastPagePosition and
+ initialize it depending on the page set.
+ (WebKit::PrintPagesData::incrementPageSequence): Use 2 step
+ increment when printing only odd/even pages.
+ (WebKit::WebPrintOperationGtk::WebPrintOperationGtk): Initialize
+ m_manualPageSet to GTK_PAGE_SET_ALL.
+
+2012-02-17 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Allow printing multiple pages per sheet in WebKit2 for printers that don't support it
+ https://bugs.webkit.org/show_bug.cgi?id=78715
+
+ Reviewed by Gustavo Noronha Silva.
+
+ * UIProcess/API/gtk/WebKitPrintOperation.cpp:
+ (webkitPrintOperationRunDialogUnix): Enable multiple pages per
+ sheet options in print dialog.
+ * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
+ (WebKit::PrintPagesData::PrintPagesData): Initialize sheetNumber
+ and numberOfSheets. Move pagePosition to WebPrintOperationGtk.
+ (WebKit::PrintPagesData::incrementPageSequence): Increment current
+ sheet and page position.
+ (WebKit::WebPrintOperationGtk::WebPrintOperationGtk):
+ (WebKit::WebPrintOperationGtk::currentPageIsFirstPageOfSheet):
+ Helper function to check whether current pages is the first one of
+ the current sheet.
+ (WebKit::WebPrintOperationGtk::currentPageIsLastPageOfSheet):
+ Helper function to check whether current pages is the last one of
+ the current sheet.
+ (WebKit::WebPrintOperationGtk::getRowsAndColumnsOfPagesPerSheet):
+ Returns the number of rows and columns of pages per sheet.
+ (WebKit::WebPrintOperationGtk::getPositionOfPageInSheet): Returns
+ the row and column number of the current page in the current sheet.
+ (WebKit::WebPrintOperationGtk::prepareContextToDraw): Translate,
+ scale and rotate accordingly to render every page in the right
+ place of the sheet.
+ (WebKit::WebPrintOperationGtk::renderPage): Call
+ prepareContextToDraw() before drawing the page.
+ * WebProcess/WebPage/gtk/WebPrintOperationGtk.h:
+ (WebKit::WebPrintOperationGtk::setNumberOfPagesToPrint):
+ (WebKit::WebPrintOperationGtk::pagePosition):
+ (WebKit::WebPrintOperationGtk::setPagePosition):
+ (WebKit::WebPrintOperationGtk::numberUp):
+ (WebKit::WebPrintOperationGtk::numberUpLayout):
+
+2012-02-17 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Rename WebKitPrintOperation::done signal to ::finished in WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=78893
+
+ Reviewed by Gustavo Noronha Silva.
+
+ And it's not emitted anynmore when the print dialog has been
+ cancelled. Since it's not possible to know whether the print
+ dialog was cancelled or not, the enum WebKitPrintOperationResponse
+ has been added, with Print and Cancel values, and it's used as
+ return value of webkit_print_operation_run_dialog().
+
+ * UIProcess/API/gtk/WebKitPrintOperation.cpp:
+ (webkit_print_operation_class_init): Rename done as finished.
+ (webkitPrintOperationRunDialogUnix): Return a
+ WebKitPrintOperationResponse instead of bool.
+ (webkitPrintOperationRunDialogWin32): Ditto.
+ (drawPagesForPrintingCompleted): Emit finished instead of done.
+ (webkitPrintOperationRunDialogForFrame): Do not emit finished if
+ the dialog was cancelled and return a WebKitPrintOperationResponse.
+ (webkit_print_operation_run_dialog): Return
+ WebKitPrintOperationResponse.
+ * UIProcess/API/gtk/WebKitPrintOperation.h: Add
+ WebKitPrintOperationResponse enum.
+ * UIProcess/API/gtk/WebKitPrintOperationPrivate.h:
+ * UIProcess/API/gtk/WebKitWebView.cpp:
+ (webkitWebViewPrintFrame): Check whether the dialog has been
+ cancelled or not and connect to finish when the print operation is
+ in progress to release the print operation object when printing
+ finishes.
+ * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add
+ WebKitPrintOperationResponse symbol.
+ * UIProcess/API/gtk/tests/TestPrinting.cpp:
+ (testPrintOperationPrintFinished): Use finished instead of done.
+ (testPrintOperationPrint): Ditto.
+
+2012-02-17 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Add webkit_print_operation_print() to WebKit2 GTK+ API
+ https://bugs.webkit.org/show_bug.cgi?id=76536
+
+ Reviewed by Gustavo Noronha Silva.
+
+ * UIProcess/API/gtk/WebKitPrintOperation.cpp:
+ (webkitPrintOperationPrintPagesForFrame): Helper function to call
+ WebPageProxy::drawPagesForPrinting using the given
+ GtkPrintSettings and GtkPageSetup.
+ (webkitPrintOperationRunDialogForFrame): Use
+ webkitPrintOperationPrintPagesForFrame().
+ (webkit_print_operation_print): Print directly using current
+ GtkPrintSettings and GtkPageSetup without showing the print
+ dialog.
+ * UIProcess/API/gtk/WebKitPrintOperation.h:
+ * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbols.
+ * UIProcess/API/gtk/tests/GNUmakefile.am:
+ * UIProcess/API/gtk/tests/TestPrinting.cpp:
+ (testPrintOperationPrintLoadChanged):
+ (testPrintOperationPrintDone):
+ (testPrintOperationPrintPrinter):
+ (testPrintOperationPrint):
+ (beforeAll):
+ (afterAll):
+
+2012-02-17 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ [Qt][WK2] Allow partial updates
+ https://bugs.webkit.org/show_bug.cgi?id=78824
+
+ Instead of using UpdateInfo to fill the entire tile's texture, we use it as a patch that
+ contains only the dirty rectangle of the current paint. This requires a lot less memory
+ for small updates, for example when typing a text in an input field.
+ This shows a significant reduction in overhead when testing on Mac with Instruments.
+
+ Reviewed by Simon Hausmann.
+
+ * UIProcess/qt/LayerBackingStore.cpp:
+ (WebKit::LayerBackingStoreTile::swapBuffers):
+ (WebKit::LayerBackingStoreTile::setBackBuffer):
+ (WebKit):
+ (WebKit::LayerBackingStore::updateTile):
+ * UIProcess/qt/LayerBackingStore.h:
+ (LayerBackingStoreTile):
+ * UIProcess/qt/LayerTreeHostProxyQt.cpp:
+ (WebKit::LayerTreeHostProxy::updateTileForLayer):
+ * WebProcess/WebPage/TiledBackingStoreRemoteTile.cpp:
+ (WebKit::TiledBackingStoreRemoteTile::updateBackBuffer):
+
+2012-02-16 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Make sure print operation object is alive until printing finishes in WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=78829
+
+ Reviewed by Martin Robinson.
+
+ * UIProcess/API/gtk/WebKitPrintOperation.cpp:
+ (drawPagesForPrintingCompleted): Adopt the WebKitPrintOperation
+ reference so that it's released when the callback finishes.
+ (webkitPrintOperationRunDialogForFrame): Pass a reference of
+ WebKitPrintOperation to the printing callback.
+
+2012-02-15 Geoffrey Garen <ggaren@apple.com>
+
+ Made Weak<T> single-owner, adding PassWeak<T>
+ https://bugs.webkit.org/show_bug.cgi?id=78740
+
+ Reviewed by Sam Weinig.
+
+ * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
+ (WebKit::NPRuntimeObjectMap::getOrCreateJSObject): Use raw pointer and
+ PassWeak<T>, as required by our new hash map API.
+
+2012-02-16 Sergio Villar Senin <svillar@igalia.com>
+
+ [soup] Move important SoupSession feature initialization to WebCore
+ https://bugs.webkit.org/show_bug.cgi?id=68602
+
+ Reviewed by Martin Robinson.
+
+ Moved content sniffer and decoder initialization from the
+ WebProcess to WebCore because network stuff will not work as
+ expected without them.
+
+ No new tests required as we're just moving stuff from the
+ WebProcess to WebCore.
+
+ * WebProcess/gtk/WebProcessMainGtk.cpp:
+ (WebKit::WebProcessMainGtk):
+
+2012-02-16 Philippe Normand <pnormand@igalia.com>
+
+ Unreviewed, rolling out r107941.
+ http://trac.webkit.org/changeset/107941
+ https://bugs.webkit.org/show_bug.cgi?id=68602
+
+ Broke 23 http tests on GTK
+
+ * WebProcess/gtk/WebProcessMainGtk.cpp:
+ (WebKit::WebProcessMainGtk):
+
+2012-02-16 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ [Texmap] Improve the way we deal with BGRA extension
+ https://bugs.webkit.org/show_bug.cgi?id=78822
+
+ Get rid of swizzling in the web process. Instead, we moved swizzling back to
+ TextureMapperGL, as we're moving towards a setup where textures are uploaded
+ in the web process.
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * UIProcess/qt/LayerBackingStore.cpp:
+ (WebKit::LayerBackingStoreTile::swapBuffers):
+ * UIProcess/qt/LayerTreeHostProxyQt.cpp:
+ (WebKit::LayerTreeHostProxy::createImage):
+ * WebProcess/WebPage/TiledBackingStoreRemoteTile.cpp:
+ (WebKit::TiledBackingStoreRemoteTile::updateBackBuffer):
+ * WebProcess/WebPage/qt/LayerTreeHostQt.cpp:
+ (WebKit::LayerTreeHostQt::adoptImageBackingStore):
+
+2012-02-16 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ Unreviewed. Fix WebKit2 GTK+ build after r107947.
+
+ * UIProcess/API/gtk/WebKitPrintOperation.cpp:
+ (webkitPrintOperationRunDialogForFrame):
+
+2012-02-16 Alexander Færøy <ahf@0x90.dk>
+
+ [Qt] Fix linking in debug builds on Mac OS X
+ https://bugs.webkit.org/show_bug.cgi?id=78811
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * UIProcess/API/qt/tests/bytearraytestdata.h:
+
+2012-02-16 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Page content is incorrectly translated whenh rendering pages for printing in WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=78712
+
+ Reviewed by Martin Robinson.
+
+ * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
+ (WebKit::WebPrintOperationGtk::enumeratePrintersFunction):
+ Simplify the code to select the printer.
+ (WebKit::WebPrintOperationGtk::renderPage): Call cairo_save()
+ before rendering the page and cairo_restore() when page has been
+ rendered.
+
+2012-02-16 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Add WebKitPrintOperation to WebKit2 GTK+ API
+ https://bugs.webkit.org/show_bug.cgi?id=76448
+
+ Reviewed by Martin Robinson.
+
+ * GNUmakefile.am: Add new files to compilation.
+ * UIProcess/API/gtk/WebKitDefines.h:
+ * UIProcess/API/gtk/WebKitPrintOperation.cpp: Added.
+ (webViewDestroyed): Delete the print operation when the view
+ widget associated is destroyed.
+ (webkitPrintOperationConstructed): Connect to destroy signal of
+ associated web view.
+ (webkitPrintOperationGetProperty):
+ (webkitPrintOperationSetProperty):
+ (webkit_print_operation_init):
+ (webkit_print_operation_class_init):
+ (webkitPrintOperationRunDialogUnix): Use GtkPrintUnixDialog to
+ show the printing dialog in UNIX platforms.
+ (webkitPrintOperationRunDialogWin32): Empty, not implemented yet.
+ (drawPagesForPrintingCompleted): Callback called when printing
+ operation has finished in the web process.
+ (webkitPrintOperationRunDialogForFrame): Run the printing dialog
+ and start printing the given frame.
+ (webkit_print_operation_new): Create a new print operation for the
+ given web view.
+ (webkit_print_operation_get_print_settings):
+ (webkit_print_operation_set_print_settings):
+ (webkit_print_operation_get_page_setup):
+ (webkit_print_operation_set_page_setup):
+ (webkit_print_operation_run_dialog): Run the print dialog to print
+ the web view main frame.
+ * UIProcess/API/gtk/WebKitPrintOperation.h: Added.
+ * UIProcess/API/gtk/WebKitPrintOperationPrivate.h: Added.
+ * UIProcess/API/gtk/WebKitUIClient.cpp:
+ (printFrame): Call webkitWebViewPrintFrame.
+ (attachUIClientToView): Add implementation for
+ printFrame callback.
+ * UIProcess/API/gtk/WebKitWebView.cpp:
+ (webkit_web_view_class_init): Add WebKitWebView::print-requested
+ signal.
+ (webkitWebViewPrintFrame): Emit print-requested and show the print
+ dialog to print the frame when not signal is not handled by user.
+ * UIProcess/API/gtk/WebKitWebView.h:
+ * UIProcess/API/gtk/WebKitWebViewPrivate.h:
+ * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section for
+ WebKitPrintOperation.
+ * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbols.
+ * UIProcess/API/gtk/tests/GNUmakefile.am:
+ * UIProcess/API/gtk/tests/TestPrinting.cpp: Added.
+ (testPrintOperationPrintSettings):
+ (webViewPrintRequestedCallback):
+ (testWebViewPrintRequested):
+ (beforeAll):
+ (afterAll):
+ * UIProcess/API/gtk/webkit2.h: Include WebKitPrintOperation.h.
+
+2012-02-16 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Gtk][Efl][Qt] Move OpenGLShims out of cairo/ subdirectory
+ https://bugs.webkit.org/show_bug.cgi?id=78800
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * UIProcess/qt/LayerTreeHostProxyQt.cpp: Adjust to changed OpenGLShims.h
+ location - no more cairo prefix needed.
+
+2012-02-16 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ [Qt][WK2] Allow opaque tiles
+ https://bugs.webkit.org/show_bug.cgi?id=78809
+
+ Set the supportsAlpha flag for TiledBackingStore when the layer has contentsOpaque enabled.
+ Use the flag for ShareableBitmaps created by TiledBackingStore.
+
+ For now this will not have impact on performance/memory, because we allocate the same type
+ of buffers for opaque and transparent tiles.
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * WebProcess/WebCoreSupport/WebGraphicsLayer.cpp:
+ (WebCore::WebGraphicsLayer::setContentsOpaque):
+ (WebCore::WebGraphicsLayer::setContentsScale):
+ (WebCore::WebGraphicsLayer::createBackingStore):
+ (WebCore):
+ (WebCore::WebGraphicsLayer::updateContentBuffers):
+ * WebProcess/WebCoreSupport/WebGraphicsLayer.h:
+ (WebGraphicsLayer):
+ * WebProcess/WebPage/TiledBackingStoreRemoteTile.cpp:
+ (WebKit::TiledBackingStoreRemoteTile::updateBackBuffer):
+
+2012-02-16 Sergio Villar Senin <svillar@igalia.com>
+
+ [soup] Move important SoupSession feature initialization to WebCore
+ https://bugs.webkit.org/show_bug.cgi?id=68602
+
+ Reviewed by Martin Robinson.
+
+ Moved content sniffer and decoder initialization from the
+ WebProcess to WebCore because network stuff will not work as
+ expected without them.
+
+ No new tests required as we're just moving stuff from the
+ WebProcess to WebCore.
+
+ * WebProcess/gtk/WebProcessMainGtk.cpp:
+ (WebKit::WebProcessMainGtk):
+
+2012-02-16 Adenilson Cavalcanti <cavalcantii@gmail.com>
+
+ [Qt][WK2] Split QWebPermissionRequest into QWebSecurityOrigin
+ https://bugs.webkit.org/show_bug.cgi?id=73215
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Introducing a new class to expose security origin information
+ (port/scheme/etc), useful for inspecting the origin of permission
+ requests.
+
+ * Target.pri:
+ * UIProcess/API/qt/qtwebsecurityorigin.cpp: Added.
+ (QtWebSecurityOrigin::QtWebSecurityOrigin):
+ (QtWebSecurityOrigin::~QtWebSecurityOrigin):
+ (QtWebSecurityOrigin::host):
+ (QtWebSecurityOrigin::scheme):
+ (QtWebSecurityOrigin::path):
+ (QtWebSecurityOrigin::port):
+ (QtWebSecurityOrigin::setHost):
+ (QtWebSecurityOrigin::setScheme):
+ (QtWebSecurityOrigin::setPath):
+ (QtWebSecurityOrigin::setPort):
+ * UIProcess/API/qt/qtwebsecurityorigin_p.h: Added.
+ * UIProcess/API/qt/tests/qmltests/WebView/tst_origin.qml: Added.
+ * UIProcess/API/qt/qwebpermissionrequest.cpp:
+ (QWebPermissionRequestPrivate::QWebPermissionRequestPrivate):
+ (QWebPermissionRequest::securityOrigin):
+ * UIProcess/API/qt/qwebpermissionrequest_p.h:
+ * UIProcess/API/qt/tests/qmltests/qmltests.pro:
+
+2012-02-16 Patrick Gansterer <paroga@webkit.org>
+
+ [CMake] Add missing include directories.
+
+ * CMakeLists.txt:
+
+2012-02-16 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Document that local paths in html loaded with loadHTML might cause the web process to terminate
+ https://bugs.webkit.org/show_bug.cgi?id=78719
+
+ Reviewed by Martin Robinson.
+
+ * UIProcess/API/gtk/WebKitWebView.cpp:
+
+2012-02-15 Anders Carlsson <andersca@apple.com>
+
+ Add TiledCoreAnimationDrawingArea::forceRepaint
+ https://bugs.webkit.org/show_bug.cgi?id=78749
+ <rdar://problem/10866221>
+
+ Reviewed by Sam Weinig.
+
+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+ (WebKit::TiledCoreAnimationDrawingArea::forceRepaint):
+ Force a repaint and synchronize the layer tree to the UI process.
+
+2012-02-15 Enrica Casucci <enrica@apple.com>
+
+ Refactor ClipboardMac class to use PlatformStrategies.
+ https://bugs.webkit.org/show_bug.cgi?id=78554
+
+ Reviewed by Anders Carlsson.
+
+ * WebProcess/WebCoreSupport/WebDragClient.h: Changed method signature to reference
+ the pasteboard by name.
+ * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: Added new methods.
+ (WebKit::WebPlatformStrategies::changeCount):
+ (WebKit::WebPlatformStrategies::uniqueName):
+ * WebProcess/WebCoreSupport/WebPlatformStrategies.h: Ditto.
+ * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
+ (WebKit::WebDragClient::declareAndWriteDragImage): Changed method signature to reference
+ the pasteboard by name.
+
+2012-02-15 Sadrul Habib Chowdhury <sadrul@chromium.org>
+
+ Notify ChromeClient when touch-event handlers are installed/removed.
+ https://bugs.webkit.org/show_bug.cgi?id=77440
+
+ Reviewed by Darin Fisher and Ryosuke Niwa.
+
+ * UIProcess/WebPageProxy.h:
+ (WebKit::WebPageProxy::numTouchEventHandlersChanged):
+ * WebProcess/WebCoreSupport/WebChromeClient.h:
+
+2012-02-15 Patrick Gansterer <paroga@webkit.org>
+
+ [CMake] Move RunLoop to WebCore/platform
+ https://bugs.webkit.org/show_bug.cgi?id=78504
+
+ Reviewed by Adam Roben.
+
+ * CMakeLists.txt: Remove RunLoop.cpp from list of souces.
+
+2012-02-14 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt] Eliminate first set of QtWidgets dependencies from WebCore
+ https://bugs.webkit.org/show_bug.cgi?id=78611
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * UIProcess/qt/QtWebPageEventHandler.cpp: Add missing QCursor include
+ to fix compilation.
+
+2012-02-15 Roland Steiner <rolandsteiner@chromium.org>
+
+ <style scoped>: Allow <style scoped> as a direct child of a ShadowRoot
+ https://bugs.webkit.org/show_bug.cgi?id=77853
+
+ numberOfScopedHTMLStyleChildren got moved from Element into Node.
+
+ Reviewed by Dimitri Glazkov.
+
+ * win/WebKit2.def:
+ * win/WebKit2CFLite.def:
+
+2012-02-15 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ [Texmap] Divide TextureMapperNode.cpp to 3 files.
+ https://bugs.webkit.org/show_bug.cgi?id=76660
+
+ Rename TextureMapperNode to TextureMapperLayer.
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * UIProcess/qt/LayerTreeHostProxyQt.cpp:
+ (WebKit::LayerTreeHostProxy::createLayer):
+ (WebKit::LayerTreeHostProxy::paintToCurrentGLContext):
+ (WebKit::LayerTreeHostProxy::paintToGraphicsContext):
+ (WebKit::LayerTreeHostProxy::getBackingStore):
+ (WebKit::LayerTreeHostProxy::ensureRootLayer):
+ (WebKit::LayerTreeHostProxy::purgeGLResources):
+
+2012-02-14 Anders Carlsson <andersca@apple.com>
+
+ Swipe gestures don't work if main frame has a horizontal scrollbar
+ https://bugs.webkit.org/show_bug.cgi?id=78650
+ <rdar://problem/10864993>
+
+ Reviewed by Sam Weinig.
+
+ * WebProcess/WebPage/EventDispatcher.cpp:
+ (WebKit::EventDispatcher::wheelEvent):
+ ScrollingTree::tryToHandleWheelEvent now returns a tri-state enum so handle the extra case.
+
+ (WebKit::EventDispatcher::sendDidReceiveEvent):
+ Rename this now that it takes a parameter indicating whether the event was handled or not.
+
+2012-02-14 Brian Weinstein <bweinstein@apple.com>
+
+ Web Inspector: Add the ability to show the resources panel on launch
+ https://bugs.webkit.org/show_bug.cgi?id=78641
+
+ Add WebKit2 API for the ability to show the resources panel. This calls down
+ from the WK API all the way to InspectorFrontendClientLocal::showResources.
+
+ Reviewed by Timothy Hatcher.
+
+ * UIProcess/API/C/WKInspector.cpp:
+ (WKInspectorShowResources): Call WebInspectorProxy::showResources.
+ * UIProcess/API/C/WKInspector.h:
+ * UIProcess/WebInspectorProxy.cpp:
+ (WebKit::WebInspectorProxy::showResources): Send a message to the web process.
+ * UIProcess/WebInspectorProxy.h:
+ * WebProcess/WebPage/WebInspector.cpp:
+ (WebKit::WebInspector::showResources): Call InspectorFrontendClientLocal::showResources.
+ * WebProcess/WebPage/WebInspector.h:
+ * WebProcess/WebPage/WebInspector.messages.in: Add a ShowResources message.
+
+2012-02-14 Matt Lilek <mrl@apple.com>
+
+ Don't ENABLE_DASHBOARD_SUPPORT unconditionally on all Mac platforms
+ https://bugs.webkit.org/show_bug.cgi?id=78629
+
+ Reviewed by David Kilzer.
+
+ * Configurations/FeatureDefines.xcconfig:
+
+2012-02-13 Raphael Kubo da Costa <kubo@profusion.mobi>
+
+ [CMake] Merge WebKitEfl.cmake into FindEFL.cmake.
+ https://bugs.webkit.org/show_bug.cgi?id=78566
+
+ Reviewed by Daniel Bates.
+
+ * PlatformEfl.cmake: Do not include WebKitEfl.cmake.
+
+2012-02-14 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ [Qt][Texmap] Refactor backing-store code in TextureMapper
+ https://bugs.webkit.org/show_bug.cgi?id=78305
+
+ Move the backing-store code to LayerTreeBackingStore, implementing the virtual functions
+ in TextureMapperBackingStore.
+ We save the double-buffered tile in the backing-store, and then convert them to regular
+ tiles in updateContents, based on the order of painting.
+ Use TextureMapperCompositedImage for images instead of saving our own composited image
+ registry.
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * Target.pri:
+ * UIProcess/LayerTreeHostProxy.h:
+ (WebKit):
+ (LayerTreeHostProxy):
+ * UIProcess/qt/LayerBackingStore.cpp: Added.
+ * UIProcess/qt/LayerBackingStore.h: Added.
+ * UIProcess/qt/LayerTreeHostProxyQt.cpp:
+ (WebKit::LayerTreeHostProxy::createLayer):
+ (WebKit::LayerTreeHostProxy::syncLayerParameters):
+ (WebKit::LayerTreeHostProxy::getBackingStore):
+ (WebKit::LayerTreeHostProxy::createTile):
+ (WebKit::LayerTreeHostProxy::removeTile):
+ (WebKit::LayerTreeHostProxy::updateTile):
+ (WebKit::LayerTreeHostProxy::createImage):
+ (WebKit::LayerTreeHostProxy::assignImageToLayer):
+ (WebKit::LayerTreeHostProxy::purgeGLResources):
+ * WebProcess.pro:
+
+
+2012-02-14 Shinya Kawanaka <shinyak@google.com>
+
+ Use youngestShadowRoot and oldestShadowRoot instead of Element::shadowRoot().
+ https://bugs.webkit.org/show_bug.cgi?id=78455
+
+ Reviewed by Hajime Morita.
+
+ Exports necesarry symbols.
+
+ * win/WebKit2.def:
+ * win/WebKit2CFLite.def:
+
+2012-02-14 Alexey Proskuryakov <ap@apple.com>
+
+ [Mac][Win][WK2] Switch to RFC 6455 protocol for WebSockets
+ https://bugs.webkit.org/show_bug.cgi?id=78541
+ <rdar://problem/10036695>
+
+ Reviewed by Kent Tamura.
+
+ * Shared/WebPreferencesStore.h: (WebKit): Changed default value of the preference.
+
+2012-02-13 W. James MacLean <wjmaclean@chromium.org>
+
+ [chromium] Remove obsolete zoom animation pathway.
+ https://bugs.webkit.org/show_bug.cgi?id=78359
+
+ Reviewed by James Robinson.
+
+ This patch removes dead code from the previous incarnation of zoom animation for chromium.
+
+ WebProcess/Plugins/PDF/BuiltInPDFView.h:
+ (BuiltInPDFView):
+
+2012-02-13 Enrica Casucci <enrica@apple.com>
+
+ Refactor Mac platform implementation of the Pasteboard class to use Platform Strategies.
+ https://bugs.webkit.org/show_bug.cgi?id=78282
+
+ This patch removes any accesss to the NSPasteboard object from the Pasteboard class which
+ now makes use of a new pasteboardStrategy object that is implemented both in WebKit and
+ WebKit2. The actual access to NSPasteboard is now performed inside the PlatformPasteboard
+ class. Currently both WebKit and WebKit2 use the same implementation of the PasteboardStrategy
+ interface but this one more step in the direction of removing access to NSPasteboard from
+ the WebProcess.
+ As part of the refactoring the I've reduced to a minimum the use of OBJ-C classes.
+
+ Reviewed by Anders Carlsson.
+
+ * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: Added implementation of PasteboardStrategy
+ interface.
+ (WebKit::WebPlatformStrategies::createPasteboardStrategy):
+ (WebKit::WebPlatformStrategies::getTypes):
+ (WebKit::WebPlatformStrategies::bufferForType):
+ (WebKit::WebPlatformStrategies::getPathnamesForType):
+ (WebKit::WebPlatformStrategies::stringForType):
+ (WebKit::WebPlatformStrategies::copy):
+ (WebKit::WebPlatformStrategies::setTypes):
+ (WebKit::WebPlatformStrategies::setBufferForType):
+ (WebKit::WebPlatformStrategies::setPathnamesForType):
+ (WebKit::WebPlatformStrategies::setStringForType):
+ * WebProcess/WebCoreSupport/WebPlatformStrategies.h: Added PasteboardStrategy.
+
+2012-02-13 Anders Carlsson <andersca@apple.com>
+
+ The scrolling tree needs to know about the back forward state of the page
+ https://bugs.webkit.org/show_bug.cgi?id=78523
+ <rdar://problem/10756548>
+
+ Reviewed by Sam Weinig.
+
+ Pass the back/forward state in the WheelEvent message. This is pretty hacky but works well.
+
+ * Platform/CoreIPC/HandleMessage.h:
+ (CoreIPC):
+ (CoreIPC::callMemberFunction):
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::handleWheelEvent):
+ (WebKit::WebPageProxy::didReceiveEvent):
+ * WebProcess/WebPage/EventDispatcher.cpp:
+ (WebKit::EventDispatcher::wheelEvent):
+ * WebProcess/WebPage/EventDispatcher.h:
+ (EventDispatcher):
+ * WebProcess/WebPage/EventDispatcher.messages.in:
+
+2012-02-13 Dan Bernstein <mitz@apple.com>
+
+ WebKit2 build emits a warning about not stripping code-signed PluginProcess.app when copying it into the framework
+ https://bugs.webkit.org/show_bug.cgi?id=78451
+
+ Reviewed by Sam Weinig.
+
+ * Configurations/Base.xcconfig: Set COPY_PHASE_STRIP to NO.
+
+2012-02-13 Sam Weinig <sam@webkit.org>
+
+ Windows build fix.
+
+ * UIProcess/win/WebPopupMenuProxyWin.cpp:
+ (WebKit::WebPopupMenuProxyWin::scrollToRevealSelection):
+
+2012-02-13 Zalan Bujtas <zbujtas@gmail.com>
+
+ Manage ShareableBitmap object lifecycle properly, when QImage is created
+ using the shared data.
+ https://bugs.webkit.org/show_bug.cgi?id=77546
+
+ Reviewed by Simon Hausmann.
+
+ * Shared/ShareableBitmap.h:
+ (ShareableBitmap):
+ * Shared/qt/ShareableBitmapQt.cpp:
+ (WebKit::ShareableBitmap::createQImage):
+ (WebKit):
+ (WebKit::ShareableBitmap::releaseSharedMemoryData):
+
+2012-02-06 Raphael Kubo da Costa <kubo@profusion.mobi>
+
+ [EFL] Drop support for the Curl network backend.
+ https://bugs.webkit.org/show_bug.cgi?id=77874
+
+ Reviewed by Eric Seidel.
+
+ Nobody seems to be maintaining the Curl backend in WebCore, the
+ EFL port developers all seem to be using the Soup backend and the
+ port itself has many features which are only implemented for the
+ latter.
+
+ * PlatformEfl.cmake: Unconditionally build the glib/soup source
+ files and unconditionally add the required include directories and
+ libraries.
+ * WebProcess/efl/WebProcessMainEfl.cpp:
+ (WebKit::WebProcessMainEfl): Remove USE(SOUP) check.
+
+2012-02-11 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r107435.
+ http://trac.webkit.org/changeset/107435
+ https://bugs.webkit.org/show_bug.cgi?id=78410
+
+ It broke the Qt build (Requested by Ossy on #webkit).
+
+ * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
+ * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
+ (WebPlatformStrategies):
+
+2012-02-10 Brian Weinstein <bweinstein@apple.com>
+
+ Web Inspector: Add the ability to jump to the source for a given frame
+ https://bugs.webkit.org/show_bug.cgi?id=78396
+
+ Add WebKit2 API for the ability to show the source of a frame in the web inspector. This calls down
+ from the WK API all the way to InspectorFrontendClientLocal::showMainResourceForFrame.
+
+ Reviewed by Tim Hatcher.
+
+ * UIProcess/API/C/WKInspector.cpp:
+ (WKInspectorShowMainResourceForFrame): Call WebInspectorProxy::showMainResourceForFrame.
+ * UIProcess/API/C/WKInspector.h:
+
+ * UIProcess/WebInspectorProxy.cpp:
+ (WebKit::WebInspectorProxy::showMainResourceForFrame): Send a message to the web process, passing
+ the frame ID of the frame we want to show the main resource of.
+ * UIProcess/WebInspectorProxy.h:
+
+ * WebProcess/WebPage/WebInspector.cpp:
+ (WebKit::WebInspector::showMainResourceForFrame): Get the WebFrame for the frame we want to show the
+ main resource of from its ID. If we found a frame, call InspectorFrontendClientLocal::showMainResourceForFrame.
+ * WebProcess/WebPage/WebInspector.h:
+
+ * WebProcess/WebPage/WebInspector.messages.in: Add a new message.
+
+2012-02-10 Adam Klein <adamk@chromium.org>
+
+ Enable MUTATION_OBSERVERS by default on all platforms
+ https://bugs.webkit.org/show_bug.cgi?id=78196
+
+ Reviewed by Ojan Vafai.
+
+ * Configurations/FeatureDefines.xcconfig:
+
+2012-02-10 Enrica Casucci <enrica@apple.com>
+
+ Refactor Mac platform implementation of the Pasteboard class to use Platform Strategies.
+ https://bugs.webkit.org/show_bug.cgi?id=78282
+
+ This patch removes any accesss to the NSPasteboard object from the Pasteboard class which
+ now makes use of a new pasteboardStrategy object that is implemented both in WebKit and
+ WebKit2. The actual access to NSPasteboard is now performed inside the PlatformPasteboard
+ class. Currently both WebKit and WebKit2 use the same implementation of the PasteboardStrategy
+ interface but this one more step in the direction of removing access to NSPasteboard from
+ the WebProcess.
+ As part of the refactoring the I've reduced to a minimum the use of OBJ-C classes.
+
+ Reviewed by Anders Carlsson.
+
+ * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: Added implementation of PasteboardStrategy
+ interface.
+ (WebKit::WebPlatformStrategies::createPasteboardStrategy):
+ (WebKit::WebPlatformStrategies::getTypes):
+ (WebKit::WebPlatformStrategies::bufferForType):
+ (WebKit::WebPlatformStrategies::getPathnamesForType):
+ (WebKit::WebPlatformStrategies::stringForType):
+ (WebKit::WebPlatformStrategies::copy):
+ (WebKit::WebPlatformStrategies::setTypes):
+ (WebKit::WebPlatformStrategies::setBufferForType):
+ (WebKit::WebPlatformStrategies::setPathnamesForType):
+ (WebKit::WebPlatformStrategies::setStringForType):
+ * WebProcess/WebCoreSupport/WebPlatformStrategies.h: Added PasteboardStrategy.
+
+2012-02-09 Timothy Hatcher <timothy@apple.com>
+
+ Prevent attaching when inspecting the Web Inspector.
+
+ Also adds some comments about keeping in sync with InspectorFrontendClientLocal::canAttachWindow
+ and why there are two implementations of the same function.
+
+ https://webkit.org/b/78304
+
+ Reviewed by Brian Weinstein.
+
+ * UIProcess/WebInspectorProxy.cpp:
+ (WebKit::WebInspectorProxy::canAttach): Prevent attaching when the page is an inspector page.
+ Added comments about InspectorFrontendClientLocal::canAttachWindow.
+ * UIProcess/WebInspectorProxy.h:
+ (WebInspectorProxy): Added comment about keeping in sync with InspectorFrontendClientLocal.
+
+2012-02-09 Alexey Proskuryakov <ap@apple.com>
+
+ Managed network proxy settings are not used in WebProcess
+ https://bugs.webkit.org/show_bug.cgi?id=78288
+ <rdar://problem/9962116>
+
+ Reviewed by Anders Carlsson.
+
+ * WebProcess/com.apple.WebProcess.sb: Allow reading managed preferences.
+
+2012-02-09 Alexey Proskuryakov <ap@apple.com>
+
+ ASSERTION FAILED: checkURLReceivedFromWebProcess(originalURL) loading a local file, if the WebProcess crashed
+ https://bugs.webkit.org/show_bug.cgi?id=70845
+ <rdar://problem/10269985>
+
+ Reviewed by Anders Carlsson.
+
+ This also fixes some case where WebProcess did not get a sandbox extension after a crash.
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::reattachToWebProcessWithItem): We no longer need to pass a sandbox
+ extension here, we're now passing it at b/f navigation bottleneck.
+ (WebKit::WebPageProxy::reload): Pass a sandbox extension - reload may mean reloading an error
+ page after a crash, so WebProcess may no longer have the extension.
+ (WebKit::WebPageProxy::goForward): We no longer need to pass a sandbox extension here,
+ we're now passing it at b/f navigation bottleneck. Also, fixed a bug where we first null checked
+ a WebBackForwardListItem pointer, and then used it anyway.
+ (WebKit::WebPageProxy::goBack): Ditto.
+ (WebKit::WebPageProxy::goToBackForwardItem): Ditto.
+ (WebKit::WebPageProxy::backForwardGoToItem): This is the bottleneck. We get here both for UI
+ actions like pressing the Back button, and for window.history.go() navigations. JS navigations
+ previously didn't open up the sandbox. URLs in UI process b/f list are trusted, so it's
+ always OK to grant a sandbox extension if one of them is a file: one.
+
+ * UIProcess/WebPageProxy.h: backForwardGoToItem() now returns a sandbox extension handle.
+
+ * UIProcess/WebPageProxy.messages.in: Ditto.
+
+ * UIProcess/WebProcessProxy.cpp:
+ (WebKit::WebProcessProxy::checkURLReceivedFromWebProcess): If a URL is in UI process b/f
+ list, then it has been already vetted as something the Web process knows about. No need to
+ crash if it actually attempts going there.
+ (WebKit::WebProcessProxy::didReceiveInvalidMessage): Removed a useless comment (we have tons
+ of fprintfs besides this one). Fixed log message syntax.
+
+ * UIProcess/cf/WebPageProxyCF.cpp: (WebKit::WebPageProxy::restoreFromSessionStateData):
+ We no longer need to pass a sandbox extension here, we're now passing it at b/f navigation
+ bottleneck.
+
+ * WebProcess/WebPage/WebBackForwardListProxy.cpp: (WebKit::WebBackForwardListProxy::goToItem):
+ We now get an extension here, when telling UI process that we're navigating to a b/f list item.
+
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::reload): Use the extension we're getting.
+ (WebKit::WebPage::goForward): Don't use one we're not getting.
+ (WebKit::WebPage::goBack): Ditto.
+ (WebKit::WebPage::goToBackForwardItem): Ditto.
+ (WebKit::WebPage::restoreSessionAndNavigateToCurrentItem): Ditto.
+
+ * WebProcess/WebPage/WebPage.h: Adjusted signatures accordingly.
+
+ * WebProcess/WebPage/WebPage.messages.in: Ditto.
+
+2012-02-09 Matthew Delaney <mdelaney@apple.com>
+
+ HiDPI: WebKit2's drag images are blurry
+ https://bugs.webkit.org/show_bug.cgi?id=67779
+
+ Use the proper deviceScaleFactor() instead of accessing _intrinsicDeviceScaleFactor
+
+ Reviewed by Beth Dakin.
+
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView _setDragImage:at:linkDrag:]):
+
+2012-02-09 Alexey Proskuryakov <ap@apple.com>
+
+ [WK2] Allow reading some debug-only preference files
+ https://bugs.webkit.org/show_bug.cgi?id=78255
+ <rdar://problem/9382382>
+ <rdar://problem/10830558>
+
+ Reviewed by Dan Bernstein.
+
+ * WebProcess/com.apple.WebProcess.sb:
+
+2012-02-09 Matthew Delaney <mdelaney@apple.com>
+
+ HiDPI: WebKit2's link-dragging images are blurry
+ https://bugs.webkit.org/show_bug.cgi?id=67779
+
+ Reviewed by Beth Dakin.
+
+ Teach startDrag about the deviceScaleFactor so that it creates
+ an appropriately scaled bitmap image to ship over.
+ * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
+ (WebKit::WebDragClient::startDrag):
+ (WebKit::convertImageToBitmap):
+
+ Have setDragImage assume that it's receiving a bitmap image scaled
+ up by the deviceScaleFactor that it sees.
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView _setDragImage:at:linkDrag:]):
+
+2012-02-09 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Add WebKitWebView::mouse-target-changed signal to WebKit2 GTK+ API
+ https://bugs.webkit.org/show_bug.cgi?id=78097
+
+ Reviewed by Martin Robinson.
+
+ * GNUmakefile.am: Add new files to compilation.
+ * UIProcess/API/gtk/WebKitHitTestResult.cpp: Added.
+ (webkitHitTestResultFinalize):
+ (webkitHitTestResultGetProperty):
+ (webkitHitTestResultSetProperty):
+ (webkit_hit_test_result_init):
+ (webkit_hit_test_result_class_init):
+ (webkitHitTestResultCreate): Create a new WebKitHitTestResult for
+ the given WKHitTestResult.
+ (stringIsEqualToCString): Helper function to compare String and
+ CString considering String::isEmpty() == CString.isNull().
+ (webkitHitTestResultCompare): Helper function to check whether a
+ WebKitHitTestResult contains the same information than the given
+ WKHitTestResult.
+ (webkit_hit_test_result_get_context):
+ (webkit_hit_test_result_context_is_link):
+ (webkit_hit_test_result_context_is_image):
+ (webkit_hit_test_result_context_is_media):
+ (webkit_hit_test_result_get_link_uri):
+ (webkit_hit_test_result_get_link_title):
+ (webkit_hit_test_result_get_link_label):
+ (webkit_hit_test_result_get_image_uri):
+ (webkit_hit_test_result_get_media_uri):
+ * UIProcess/API/gtk/WebKitHitTestResult.h: Added.
+ * UIProcess/API/gtk/WebKitHitTestResultPrivate.h:
+ * UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp:
+ (webkitNavigationPolicyDecisionCreate): Use
+ wkEventModifiersToGdkModifiers.
+ * UIProcess/API/gtk/WebKitPrivate.cpp:
+ (wkEventModifiersToGdkModifiers): Moved from
+ WebKitNavigationPolicyDecision and renamed to wkEventModifiersToGdkModifiers.
+ * UIProcess/API/gtk/WebKitPrivate.h:
+ * UIProcess/API/gtk/WebKitUIClient.cpp:
+ (mouseDidMoveOverElement): UI client callback that calls
+ webkitWebViewMouseTargetChanged().
+ (attachUIClientToView): Add implementation for callback
+ mouseDidMoveOverElement.
+ * UIProcess/API/gtk/WebKitWebView.cpp:
+ (webkit_web_view_class_init): Add
+ WebKitWebView::mouse-target-changed signal.
+ (webkitWebViewMouseTargetChanged): Emit
+ WebKitWebView::mouse-target-changed signal.
+ * UIProcess/API/gtk/WebKitWebView.h:
+ * UIProcess/API/gtk/WebKitWebViewPrivate.h:
+ * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section for
+ WebKitHitTestResult.
+ * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbols.
+ * UIProcess/API/gtk/tests/TestWebKitWebView.cpp:
+ (testWebViewMouseTarget):
+ (beforeAll):
+ * UIProcess/API/gtk/tests/WebViewTest.cpp:
+ (WebViewTest::WebViewTest):
+ (WebViewTest::~WebViewTest):
+ (parentWindowMapped):
+ (WebViewTest::showInWindowAndWaitUntilMapped): Method to add the
+ view into a popup window and show it running the main loop until
+ the window is mapped.
+ (WebViewTest::mouseMoveTo): Method to synthesize a
+ GDK_MOTION_EVENT on the given coordinates and using the given
+ modifiers.
+ * UIProcess/API/gtk/tests/WebViewTest.h:
+ * UIProcess/API/gtk/webkit2.h: Include WebKitHitTestResult.h.
+ * UIProcess/API/gtk/webkit2marshal.list:
+
+2012-02-07 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ [Qt] Fetch the visible rect from LayerTreeHost instead of keeping a copy in each layer.
+ https://bugs.webkit.org/show_bug.cgi?id=78009
+
+ Reviewed by Noam Rosenthal.
+
+ Since WebGraphicsLayers are now accessed directly from LayerTreeHost, they don't
+ need to keep the visible rect to pass it down their child layers anymore.
+
+ * WebProcess/WebCoreSupport/WebGraphicsLayer.cpp:
+ (WebCore::WebGraphicsLayer::setContentsScale):
+ (WebCore::WebGraphicsLayer::tiledBackingStoreVisibleRect):
+ (WebCore::WebGraphicsLayer::adjustVisibleRect):
+ (WebCore):
+ * WebProcess/WebCoreSupport/WebGraphicsLayer.h:
+ (WebGraphicsLayerClient):
+ (WebGraphicsLayer):
+ * WebProcess/WebPage/qt/LayerTreeHostQt.cpp:
+ (WebKit::LayerTreeHostQt::registerLayer):
+ (WebKit::LayerTreeHostQt::visibleContentsRect):
+ (WebKit):
+ (WebKit::LayerTreeHostQt::setVisibleContentRectAndScale):
+ * WebProcess/WebPage/qt/LayerTreeHostQt.h:
+ (LayerTreeHostQt):
+
+2012-02-09 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ [Qt] Control the lifetime of TiledBackingStores in WebGraphicsLayer.
+ https://bugs.webkit.org/show_bug.cgi?id=78005
+
+ Reviewed by Noam Rosenthal.
+
+ This makes sure that no empty tiles are generated for layers without contents and that
+ no interaction is made with the TiledBackingStore until we got a WebGraphicsLayerClient.
+
+ - Create the main TiledBackingStore only when the layer has drawsContent and has no
+ directly composited image
+ - Removed recreateBackingStoreIfNeeded and do the (re)creation of the backing stores
+ in updateContentBuffers
+ - Call purgeBackingStores on registered layers instead of passing it down the layer tree
+
+ * WebProcess/WebCoreSupport/WebGraphicsLayer.cpp:
+ (WebCore::WebGraphicsLayer::WebGraphicsLayer):
+ (WebCore::WebGraphicsLayer::~WebGraphicsLayer):
+ (WebCore::WebGraphicsLayer::setDrawsContent):
+ (WebCore::WebGraphicsLayer::setNeedsDisplayInRect):
+ (WebCore::WebGraphicsLayer::syncCompositingStateForThisLayerOnly):
+ (WebCore::WebGraphicsLayer::setVisibleContentRectTrajectoryVector):
+ (WebCore::WebGraphicsLayer::tiledBackingStoreContentsRect):
+ (WebCore::WebGraphicsLayer::updateContentBuffers):
+ (WebCore::WebGraphicsLayer::purgeBackingStores):
+ (WebCore::WebGraphicsLayer::setWebGraphicsLayerClient):
+ (WebCore::WebGraphicsLayer::computeTransformedVisibleRect):
+ * WebProcess/WebCoreSupport/WebGraphicsLayer.h:
+ (WebGraphicsLayer):
+ * WebProcess/WebPage/qt/LayerTreeHostQt.cpp:
+ (WebKit::LayerTreeHostQt::LayerTreeHostQt):
+ (WebKit::LayerTreeHostQt::flushPendingLayerChanges):
+ (WebKit):
+ (WebKit::LayerTreeHostQt::purgeBackingStores):
+ * WebProcess/WebPage/qt/LayerTreeHostQt.h:
+ (LayerTreeHostQt):
+
+2012-02-08 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ [Qt] Remove WebGraphicsLayer::updateTileBuffersRecursively
+ https://bugs.webkit.org/show_bug.cgi?id=78105
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ The method is unused.
+
+ * WebProcess/WebCoreSupport/WebGraphicsLayer.cpp:
+ * WebProcess/WebCoreSupport/WebGraphicsLayer.h:
+ (WebGraphicsLayer):
+
+2012-02-08 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ [Qt] Register individual WebGraphicsLayers to LayerTreeHost instead of handling the tree as a whole.
+ https://bugs.webkit.org/show_bug.cgi?id=77976
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ The LayerTreeHost association had to be maintained between re-parented layers and it would be
+ impossible to know if the layer would be disconnected from the LayerTreeHost only for reparenting
+ or disconnected for good (in other words, that the LayerTreeHost could be deleted meanwhile).
+
+ Instead, this patch assumes that graphics layers will only be in contact with one instance of
+ LayerTreeHost, and that this association can be kept until either the graphics layer or the layer
+ tree host gets deleted.
+
+ The registered layers are kept in a set and the visible rect and scales are passed directly
+ to layers instead of down the tree, through the root layer.
+
+ This also fixes the !m_layerInfo.imageBackingStoreID ASSERT that was popping in unit tests.
+
+ * WebProcess/WebCoreSupport/WebGraphicsLayer.cpp:
+ (WebCore::WebGraphicsLayer::WebGraphicsLayer):
+ (WebCore::WebGraphicsLayer::~WebGraphicsLayer):
+ (WebCore::WebGraphicsLayer::setChildren):
+ (WebCore::WebGraphicsLayer::addChild):
+ (WebCore::WebGraphicsLayer::addChildAtIndex):
+ (WebCore::WebGraphicsLayer::addChildAbove):
+ (WebCore::WebGraphicsLayer::addChildBelow):
+ (WebCore::WebGraphicsLayer::replaceChild):
+ (WebCore::WebGraphicsLayer::removeFromParent):
+ (WebCore::WebGraphicsLayer::setContentsToImage):
+ (WebCore::WebGraphicsLayer::setMaskLayer):
+ (WebCore::WebGraphicsLayer::setReplicatedByLayer):
+ (WebCore::WebGraphicsLayer::syncCompositingStateForThisLayerOnly):
+ (WebCore::WebGraphicsLayer::setVisibleContentRectAndScale):
+ (WebCore::WebGraphicsLayer::tiledBackingStoreUpdatesAllowed):
+ (WebCore::WebGraphicsLayer::createTile):
+ (WebCore::WebGraphicsLayer::updateTile):
+ (WebCore::WebGraphicsLayer::removeTile):
+ (WebCore::WebGraphicsLayer::updateContentBuffers):
+ (WebCore::WebGraphicsLayer::purgeBackingStores):
+ (WebCore::WebGraphicsLayer::setWebGraphicsLayerClient):
+ * WebProcess/WebCoreSupport/WebGraphicsLayer.h:
+ (WebCore):
+ (WebGraphicsLayerClient):
+ (WebGraphicsLayer):
+ * WebProcess/WebPage/qt/LayerTreeHostQt.cpp:
+ (WebKit::LayerTreeHostQt::~LayerTreeHostQt):
+ (WebKit::LayerTreeHostQt::LayerTreeHostQt):
+ (WebKit::LayerTreeHostQt::attachLayer):
+ (WebKit):
+ (WebKit::LayerTreeHostQt::detachLayer):
+ (WebKit::LayerTreeHostQt::setVisibleContentRectAndScale):
+ * WebProcess/WebPage/qt/LayerTreeHostQt.h:
+ (LayerTreeHostQt):
+
+2012-02-07 Andras Becsi <andras.becsi@nokia.com>
+
+ [Qt][WK2] WebView should use Flickable instead of QScroller to handle positioning
+ https://bugs.webkit.org/show_bug.cgi?id=76275
+
+ Reviewed by Simon Hausmann and Kenneth Rohde Christiansen.
+
+ The current WebView implementation uses QScroller to manage positioning but other
+ similar items in QML (ie. ListView, GridView) use Flickable as their base class.
+ Since QScroller will be dropped from Qt5 this patch removes the QScroller code
+ and redirects pan gestures to a dynamically created encapsulated Flickable instance
+ (QtFlickProvider) which handles the positioning.
+
+ This implementation only uses public QML API and does not depend on declarative-private.
+ It propagates a small subset of the Flickable API as the public API of the WebView.
+ This minimalistic API is accessible via the experimental extension and makes it possible
+ in QML to place additional items (such as toolbars, scroll indicators and floating menus)
+ aroud the page.
+ These items can use anchoring and binding for positioning on the flickable contentItem.
+
+ The patch depends however on the automatic touch->mouse event synthetization of Qt5.
+ The touch events sent to the flickProvider are translated to mouse events automatically
+ as long as the Flickable does not handle touch events directly.
+
+ After this change QtWebKit2 does no longer depend on QtWidgets and this dependency can be
+ removed in a follow-up patch.
+
+ * Target.pri: Added QtFlickProvider source.
+ * UIProcess/API/qt/qquickwebpage.cpp:
+ (QQuickWebPagePrivate::paintToCurrentGLContext):
+ (QQuickWebPage::transformToItem):
+ (QQuickWebPagePrivate::updateSize):
+ * UIProcess/API/qt/qquickwebview.cpp:
+ (QQuickWebViewPrivate::QQuickWebViewPrivate):
+ (QQuickWebViewPrivate::pageItemPos):
+ (QQuickWebViewFlickablePrivate::pageItemPos):
+ (QQuickWebViewFlickablePrivate::updateContentsSize):
+ (QQuickWebViewFlickablePrivate::onComponentComplete):
+ (QQuickWebViewFlickablePrivate::updateViewportSize):
+ (QQuickWebViewExperimental::flickableData):
+ (QQuickWebViewExperimental::contentItem):
+ (QQuickWebViewExperimental::contentWidth):
+ (QQuickWebViewExperimental::setContentWidth):
+ (QQuickWebViewExperimental::contentHeight):
+ (QQuickWebViewExperimental::setContentHeight):
+ (QQuickWebViewExperimental::contentX):
+ (QQuickWebViewExperimental::setContentX):
+ (QQuickWebViewExperimental::contentY):
+ (QQuickWebViewExperimental::setContentY):
+ (QQuickWebView::pageItemPos):
+ (QQuickWebView::updateContentsSize):
+ * UIProcess/API/qt/qquickwebview_p.h:
+ * UIProcess/API/qt/qquickwebview_p_p.h:
+ (QQuickWebViewPrivate):
+ (QQuickWebViewPrivate::updateContentsSize):
+ (QQuickWebViewFlickablePrivate):
+ * UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp:
+ (tst_QQuickWebView::scrollRequest):
+ * UIProcess/qt/QtFlickProvider.cpp: Added.
+ (QtFlickProvider::QtFlickProvider):
+ (QtFlickProvider::handleTouchFlickEvent):
+ (QtFlickProvider::contentItem):
+ (QtFlickProvider::flickableData):
+ (QtFlickProvider::contentPos):
+ (QtFlickProvider::setContentPos):
+ (QtFlickProvider::viewportSize):
+ (QtFlickProvider::setViewportSize):
+ (QtFlickProvider::returnToBounds):
+ (QtFlickProvider::cancelFlick):
+ (QtFlickProvider::isMoving):
+ (QtFlickProvider::isDragging):
+ (QtFlickProvider::isFlicking):
+ (QtFlickProvider::contentWidth):
+ (QtFlickProvider::setContentWidth):
+ (QtFlickProvider::contentHeight):
+ (QtFlickProvider::setContentHeight):
+ (QtFlickProvider::contentX):
+ (QtFlickProvider::setContentX):
+ (QtFlickProvider::contentY):
+ (QtFlickProvider::setContentY):
+ * UIProcess/qt/QtFlickProvider.h: Added.
+ (QtFlickProvider):
+ * UIProcess/qt/QtPanGestureRecognizer.cpp:
+ (WebKit::QtPanGestureRecognizer::recognize):
+ * UIProcess/qt/QtPanGestureRecognizer.h:
+ (QtPanGestureRecognizer):
+ * UIProcess/qt/QtViewportInteractionEngine.cpp:
+ (WebKit::QtViewportInteractionEngine::QtViewportInteractionEngine):
+ (WebKit::QtViewportInteractionEngine::setItemRectVisible):
+ (WebKit::QtViewportInteractionEngine::scrollStateChanged):
+ (WebKit):
+ (WebKit::QtViewportInteractionEngine::wheelEvent):
+ (WebKit::QtViewportInteractionEngine::reset):
+ (WebKit::QtViewportInteractionEngine::applyConstraints):
+ (WebKit::QtViewportInteractionEngine::scrollAnimationActive):
+ (WebKit::QtViewportInteractionEngine::panGestureActive):
+ (WebKit::QtViewportInteractionEngine::panGestureStarted):
+ (WebKit::QtViewportInteractionEngine::panGestureRequestUpdate):
+ (WebKit::QtViewportInteractionEngine::panGestureCancelled):
+ (WebKit::QtViewportInteractionEngine::panGestureEnded):
+ (WebKit::QtViewportInteractionEngine::pinchGestureRequestUpdate):
+ (WebKit::QtViewportInteractionEngine::scaleContent):
+ * UIProcess/qt/QtViewportInteractionEngine.h:
+ (QtViewportInteractionEngine):
+ * UIProcess/qt/QtWebPageEventHandler.cpp:
+ (QtWebPageEventHandler::doneWithTouchEvent):
+
2012-02-08 Keunsoon Lee <keunsoon.lee@samsung.com>
[WK2][EFL] creating dummy class derived from ResourceHandleClient for Efl download module.
diff --git a/Source/WebKit2/Configurations/Base.xcconfig b/Source/WebKit2/Configurations/Base.xcconfig
index 98d08fdc4..e736e5daa 100644
--- a/Source/WebKit2/Configurations/Base.xcconfig
+++ b/Source/WebKit2/Configurations/Base.xcconfig
@@ -60,6 +60,11 @@ WARNING_CFLAGS = -Wall -Wextra -Wchar-subscripts -Wextra-tokens -Wformat-securit
// Prevent C++ standard library operator new, delete and their related exception types from being exported as weak symbols.
OTHER_LDFLAGS = -Wl,-unexported_symbol -Wl,__ZTISt9bad_alloc -Wl,-unexported_symbol -Wl,__ZTISt9exception -Wl,-unexported_symbol -Wl,__ZTSSt9bad_alloc -Wl,-unexported_symbol -Wl,__ZTSSt9exception -Wl,-unexported_symbol -Wl,__ZdlPvS_ -Wl,-unexported_symbol -Wl,__ZnwmPv;
+CLANG_CXX_LIBRARY = $(CLANG_CXX_LIBRARY_$(TARGET_MAC_OS_X_VERSION_MAJOR));
+CLANG_CXX_LIBRARY_1060 = libstdc++;
+CLANG_CXX_LIBRARY_1070 = libc++;
+CLANG_CXX_LIBRARY_1080 = libc++;
+CLANG_CXX_LIBRARY_1090 = libc++;
REAL_PLATFORM_NAME = $(REAL_PLATFORM_NAME_$(PLATFORM_NAME));
REAL_PLATFORM_NAME_ = $(REAL_PLATFORM_NAME_macosx);
@@ -84,6 +89,7 @@ STRIP_INSTALLED_PRODUCT = $(STRIP_INSTALLED_PRODUCT_$(CURRENT_VARIANT));
STRIP_INSTALLED_PRODUCT_normal = YES;
STRIP_INSTALLED_PRODUCT_debug = NO;
+COPY_PHASE_STRIP = NO;
// Dead code stripping needs to be on in the debug variant to avoid link errors. This is due to unconditionally
// building the MiG bindings for WebKitPluginClient even when the functions that the bindings wrap are not built.
DEAD_CODE_STRIPPING = YES;
diff --git a/Source/WebKit2/Configurations/FeatureDefines.xcconfig b/Source/WebKit2/Configurations/FeatureDefines.xcconfig
index f5bc9cf39..3e2090355 100644
--- a/Source/WebKit2/Configurations/FeatureDefines.xcconfig
+++ b/Source/WebKit2/Configurations/FeatureDefines.xcconfig
@@ -37,7 +37,8 @@ ENABLE_BLOB_macosx = ENABLE_BLOB;
ENABLE_CLIENT_BASED_GEOLOCATION = $(ENABLE_CLIENT_BASED_GEOLOCATION_$(REAL_PLATFORM_NAME));
ENABLE_CLIENT_BASED_GEOLOCATION_macosx = ENABLE_CLIENT_BASED_GEOLOCATION;
-ENABLE_DASHBOARD_SUPPORT = ENABLE_DASHBOARD_SUPPORT;
+ENABLE_DASHBOARD_SUPPORT = $(ENABLE_DASHBOARD_SUPPORT_$(REAL_PLATFORM_NAME));
+ENABLE_DASHBOARD_SUPPORT_macosx = ENABLE_DASHBOARD_SUPPORT;
ENABLE_DATALIST = $(ENABLE_DATALIST_$(REAL_PLATFORM_NAME));
ENABLE_DATALIST_macosx = ENABLE_DATALIST;
@@ -95,7 +96,7 @@ ENABLE_MEDIA_SOURCE = ;
ENABLE_MEDIA_STATISTICS = ;
ENABLE_METER_TAG = ENABLE_METER_TAG;
ENABLE_MHTML = ;
-ENABLE_MUTATION_OBSERVERS = ;
+ENABLE_MUTATION_OBSERVERS = ENABLE_MUTATION_OBSERVERS;
ENABLE_NOTIFICATIONS = $(ENABLE_NOTIFICATIONS_$(REAL_PLATFORM_NAME));
ENABLE_NOTIFICATIONS_macosx = $(ENABLE_NOTIFICATIONS_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR));
diff --git a/Source/WebKit2/Configurations/Version.xcconfig b/Source/WebKit2/Configurations/Version.xcconfig
index c7089df71..8df936db5 100644
--- a/Source/WebKit2/Configurations/Version.xcconfig
+++ b/Source/WebKit2/Configurations/Version.xcconfig
@@ -22,7 +22,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
MAJOR_VERSION = 535;
-MINOR_VERSION = 20;
+MINOR_VERSION = 23;
TINY_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
diff --git a/Source/WebKit2/GNUmakefile.am b/Source/WebKit2/GNUmakefile.am
index 2b36ed3db..0e13715a3 100644
--- a/Source/WebKit2/GNUmakefile.am
+++ b/Source/WebKit2/GNUmakefile.am
@@ -88,8 +88,10 @@ libwebkit2gtkinclude_HEADERS = \
$(WebKit2)/UIProcess/API/gtk/WebKitDownload.h \
$(WebKit2)/UIProcess/API/gtk/WebKitEditingCommands.h \
$(WebKit2)/UIProcess/API/gtk/WebKitError.h \
+ $(WebKit2)/UIProcess/API/gtk/WebKitHitTestResult.h \
$(WebKit2)/UIProcess/API/gtk/WebKitNavigationPolicyDecision.h \
$(WebKit2)/UIProcess/API/gtk/WebKitPolicyDecision.h \
+ $(WebKit2)/UIProcess/API/gtk/WebKitPrintOperation.h \
$(WebKit2)/UIProcess/API/gtk/WebKitResponsePolicyDecision.h \
$(WebKit2)/UIProcess/API/gtk/WebKitSettings.h \
$(WebKit2)/UIProcess/API/gtk/WebKitURIRequest.h \
@@ -193,7 +195,7 @@ BUILT_SOURCES += $(webkit2_built_sources)
nodist_libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOURCES = \
$(webkit2_built_sources)
-libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOURCES = \
+webkit2_sources += \
Source/WebKit2/config.h \
Source/WebKit2/Platform/CoreIPC/ArgumentCoder.h \
Source/WebKit2/Platform/CoreIPC/ArgumentCoders.cpp \
@@ -539,6 +541,9 @@ libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOU
Source/WebKit2/UIProcess/API/gtk/WebKitEditingCommands.h \
Source/WebKit2/UIProcess/API/gtk/WebKitError.h \
Source/WebKit2/UIProcess/API/gtk/WebKitError.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResultPrivate.h \
Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.h \
Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp \
Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp \
@@ -549,7 +554,11 @@ libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOU
Source/WebKit2/UIProcess/API/gtk/WebKitPolicyDecisionPrivate.h \
Source/WebKit2/UIProcess/API/gtk/WebKitPolicyClient.cpp \
Source/WebKit2/UIProcess/API/gtk/WebKitPolicyClient.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperation.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperation.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperationPrivate.h \
Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.cpp \
Source/WebKit2/UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp \
Source/WebKit2/UIProcess/API/gtk/WebKitResponsePolicyDecision.h \
Source/WebKit2/UIProcess/API/gtk/WebKitResponsePolicyDecisionPrivate.h \
@@ -950,6 +959,9 @@ libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOU
Source/WebKit2/WebProcess/WebProcess.cpp \
Source/WebKit2/WebProcess/WebProcess.h
+libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOURCES = \
+ $(webkit2_sources)
+
libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CPPFLAGS = \
-fno-strict-aliasing \
$(global_cppflags) \
@@ -1038,9 +1050,11 @@ libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CXX
libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CFLAGS = \
$(global_cflags)
+if ENABLE_WEBKIT2
# Shared libraries
lib_LTLIBRARIES += \
libwebkit2gtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la
+endif
# Artificial dependency to make sure libwebkit2gtk and libwebkitgtk are not linked at the same time
# The variable creation is to avoid having automake override the entire rule instead of adding the
@@ -1094,7 +1108,9 @@ libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LIB
$(XRENDER_LIBS) \
$(XT_LIBS)
+if ENABLE_WEBKIT2
pkgconfig_DATA += Source/WebKit2/webkit2gtk-@WEBKITGTK_API_VERSION@.pc
+endif
# WebKit2 specific variables
forwarding_headers := $(GENSOURCES_WEBKIT2)/include
@@ -1228,9 +1244,10 @@ CLEANFILES += \
DISTCLEANFILES += \
$(top_builddir)/WebKit2/webkit2gtk-@WEBKITGTK_API_VERSION@.pc
-# WebKitWebProcess
+if ENABLE_WEBKIT2
libexec_PROGRAMS += \
Programs/WebKitWebProcess
+endif
Programs_WebKitWebProcess_CPPFLAGS = \
-I$(srcdir)/Source/WebKit2 \
@@ -1370,7 +1387,7 @@ webkit2_plugin_process_built_sources += \
nodist_Programs_WebKitPluginProcess_SOURCES = $(webkit2_plugin_process_built_sources)
BUILT_SOURCES += $(nodist_Programs_WebKitPluginProcess_SOURCES)
-Programs_WebKitPluginProcess_SOURCES = \
+webkit2_plugin_process_sources += \
Source/WebKit2/Platform/CoreIPC/ArgumentCoder.h \
Source/WebKit2/Platform/CoreIPC/ArgumentCoders.h \
Source/WebKit2/Platform/CoreIPC/ArgumentCoders.cpp \
@@ -1458,6 +1475,8 @@ Programs_WebKitPluginProcess_SOURCES = \
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.h \
Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp \
Source/WebKit2/gtk/PluginMainGtk.cpp
+Programs_WebKitPluginProcess_SOURCES = \
+ $(webkit2_plugin_process_sources)
Programs_WebKitPluginProcess_LDADD = \
-lpthread \
@@ -1495,7 +1514,7 @@ Programs_WebKitPluginProcess_CXXFLAGS = \
$(SYMBOL_VISIBILITY_INLINES) \
$(global_cxxflags)
-endif
+endif # ENABLE_PLUGIN_PROCESS
EXTRA_DIST += \
$(WebKit2)/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml \
diff --git a/Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.cpp b/Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.cpp
index 48da744de..f49076a6d 100644
--- a/Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.cpp
+++ b/Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.cpp
@@ -141,6 +141,16 @@ bool ArgumentDecoder::decodeBool(bool& result)
return true;
}
+bool ArgumentDecoder::decodeUInt16(uint16_t& result)
+{
+ if (!alignBufferPosition(sizeof(result), sizeof(result)))
+ return false;
+
+ result = *reinterpret_cast<uint16_t*>(m_bufferPos);
+ m_bufferPos += sizeof(result);
+ return true;
+}
+
bool ArgumentDecoder::decodeUInt32(uint32_t& result)
{
if (!alignBufferPosition(sizeof(result), sizeof(result)))
diff --git a/Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.h b/Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.h
index 786e3d693..53f9f8c6c 100644
--- a/Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.h
+++ b/Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.h
@@ -53,6 +53,7 @@ public:
bool decodeVariableLengthByteArray(DataReference&);
bool decodeBool(bool&);
+ bool decodeUInt16(uint16_t&);
bool decodeUInt32(uint32_t&);
bool decodeUInt64(uint64_t&);
bool decodeInt32(int32_t&);
@@ -126,6 +127,11 @@ template<> inline bool ArgumentDecoder::decode(bool& n)
return decodeBool(n);
}
+template<> inline bool ArgumentDecoder::decode(uint16_t& n)
+{
+ return decodeUInt16(n);
+}
+
template<> inline bool ArgumentDecoder::decode(uint32_t& n)
{
return decodeUInt32(n);
diff --git a/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp b/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp
index a6c44ea41..64c2048cf 100644
--- a/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp
+++ b/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp
@@ -115,6 +115,13 @@ void ArgumentEncoder::encodeBool(bool n)
*reinterpret_cast<bool*>(buffer) = n;
}
+void ArgumentEncoder::encodeUInt16(uint16_t n)
+{
+ uint8_t* buffer = grow(sizeof(n), sizeof(n));
+
+ *reinterpret_cast<uint16_t*>(buffer) = n;
+}
+
void ArgumentEncoder::encodeUInt32(uint32_t n)
{
uint8_t* buffer = grow(sizeof(n), sizeof(n));
diff --git a/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.h b/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.h
index beb5703db..b734d7531 100644
--- a/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.h
+++ b/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.h
@@ -46,6 +46,7 @@ public:
void encodeVariableLengthByteArray(const DataReference&);
void encodeBool(bool);
+ void encodeUInt16(uint16_t);
void encodeUInt32(uint32_t);
void encodeUInt64(uint64_t);
void encodeInt32(int32_t);
@@ -94,6 +95,11 @@ template<> inline void ArgumentEncoder::encode(const bool& n)
encodeBool(n);
}
+template<> inline void ArgumentEncoder::encode(const uint16_t& n)
+{
+ encodeUInt16(n);
+}
+
template<> inline void ArgumentEncoder::encode(const uint32_t& n)
{
encodeUInt32(n);
diff --git a/Source/WebKit2/Platform/CoreIPC/HandleMessage.h b/Source/WebKit2/Platform/CoreIPC/HandleMessage.h
index 5634a6b1e..9a08be46e 100644
--- a/Source/WebKit2/Platform/CoreIPC/HandleMessage.h
+++ b/Source/WebKit2/Platform/CoreIPC/HandleMessage.h
@@ -209,6 +209,12 @@ void callMemberFunction(Connection* connection, const Arguments2<P1, P2>& args,
(object->*function)(connection, args.argument1, args.argument2);
}
+template<typename C, typename MF, typename P1, typename P2, typename P3, typename P4>
+void callMemberFunction(Connection* connection, const Arguments4<P1, P2, P3, P4>& args, C* object, MF function)
+{
+ (object->*function)(connection, args.argument1, args.argument2, args.argument3, args.argument4);
+}
+
// Variadic dispatch functions.
template<typename C, typename MF>
diff --git a/Source/WebKit2/Platform/WorkQueue.h b/Source/WebKit2/Platform/WorkQueue.h
index 587ef892d..7b4aff71c 100644
--- a/Source/WebKit2/Platform/WorkQueue.h
+++ b/Source/WebKit2/Platform/WorkQueue.h
@@ -166,7 +166,7 @@ private:
QThread* m_workThread;
friend class WorkItemQt;
#elif PLATFORM(GTK)
- static void* startWorkQueueThread(WorkQueue*);
+ static void startWorkQueueThread(WorkQueue*);
void workQueueThreadBody();
void dispatchOnSource(GSource*, const Function<void()>&, GSourceFunc);
diff --git a/Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp b/Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp
index 112ba28b5..f0c11f977 100644
--- a/Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp
+++ b/Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp
@@ -142,10 +142,9 @@ void WorkQueue::platformInvalidate()
}
}
-void* WorkQueue::startWorkQueueThread(WorkQueue* workQueue)
+void WorkQueue::startWorkQueueThread(WorkQueue* workQueue)
{
workQueue->workQueueThreadBody();
- return 0;
}
void WorkQueue::workQueueThreadBody()
diff --git a/Source/WebKit2/PlatformEfl.cmake b/Source/WebKit2/PlatformEfl.cmake
index ef5f3953d..d8a797a6c 100644
--- a/Source/WebKit2/PlatformEfl.cmake
+++ b/Source/WebKit2/PlatformEfl.cmake
@@ -1,5 +1,3 @@
-INCLUDE(WebKitEfl)
-
LIST(APPEND WebKit2_LINK_FLAGS
${ECORE_X_LDFLAGS}
${EDJE_LDFLAGS}
@@ -44,6 +42,8 @@ LIST(APPEND WebKit2_SOURCES
UIProcess/Plugins/efl/PluginInfoStoreEfl.cpp
UIProcess/Plugins/efl/PluginProcessProxyEfl.cpp
+ WebProcess/Cookies/soup/WebCookieManagerSoup.cpp
+
WebProcess/Downloads/efl/DownloadEfl.cpp
WebProcess/Downloads/efl/FileDownloaderEfl.cpp
@@ -62,8 +62,10 @@ LIST(APPEND WebKit2_SOURCES
)
LIST(APPEND WebKit2_INCLUDE_DIRECTORIES
+ "${JAVASCRIPTCORE_DIR}/wtf/gobject"
"${WEBCORE_DIR}/platform/efl"
"${WEBCORE_DIR}/platform/graphics/cairo"
+ "${WEBCORE_DIR}/platform/network/soup"
"${WEBKIT2_DIR}/Shared/efl"
"${WEBKIT2_DIR}/UIProcess/API/efl/"
"${WEBKIT2_DIR}/WebProcess/Downloads/efl"
@@ -77,6 +79,8 @@ LIST(APPEND WebKit2_INCLUDE_DIRECTORIES
${LIBXML2_INCLUDE_DIR}
${LIBXSLT_INCLUDE_DIRS}
${SQLITE_INCLUDE_DIRS}
+ ${Glib_INCLUDE_DIRS}
+ ${LIBSOUP24_INCLUDE_DIRS}
)
LIST(APPEND WebKit2_LIBRARIES
@@ -90,6 +94,8 @@ LIST(APPEND WebKit2_LIBRARIES
${PNG_LIBRARY}
${JPEG_LIBRARY}
${CMAKE_DL_LIBS}
+ ${Glib_LIBRARIES}
+ ${LIBSOUP24_LIBRARIES}
)
LIST (APPEND WebProcess_SOURCES
@@ -112,39 +118,7 @@ ADD_CUSTOM_TARGET(forwarding-headerEfl
)
SET(ForwardingHeaders_NAME forwarding-headerEfl)
-IF (WTF_USE_SOUP)
- LIST(APPEND WebKit2_INCLUDE_DIRECTORIES
- "${WEBCORE_DIR}/platform/network/soup"
- ${LIBSOUP24_INCLUDE_DIRS}
- )
- LIST(APPEND WebKit2_LIBRARIES ${LIBSOUP24_LIBRARIES})
- LIST(APPEND WebKit2_SOURCES
- WebProcess/Cookies/soup/WebCookieManagerSoup.cpp
- )
-
- ADD_CUSTOM_TARGET(forwarding-headerSoup
- COMMAND ${PERL_EXECUTABLE} ${WEBKIT2_DIR}/Scripts/generate-forwarding-headers.pl ${WEBKIT2_DIR} ${DERIVED_SOURCES_WEBKIT2_DIR}/include soup
- )
- SET(ForwardingNetworkHeaders_NAME forwarding-headerSoup)
-ENDIF ()
-
-IF (WTF_USE_CURL)
- LIST(APPEND WebKit2_INCLUDE_DIRECTORIES
- "${WEBCORE_DIR}/platform/network/curl"
- ${CURL_INCLUDE_DIRS}
- )
- LIST(APPEND WebKit2_LIBRARIES ${CURL_LIBRARIES})
- LIST(APPEND WebKit2_SOURCES
- WebProcess/Cookies/curl/WebCookieManagerCurl.cpp
- )
-ENDIF ()
-
-IF (ENABLE_GLIB_SUPPORT)
- LIST(APPEND WebKit2_INCLUDE_DIRECTORIES
- ${Glib_INCLUDE_DIRS}
- ${JAVASCRIPTCORE_DIR}/wtf/gobject
- )
- LIST(APPEND WebKit2_LIBRARIES
- ${Glib_LIBRARIES}
- )
-ENDIF ()
+ADD_CUSTOM_TARGET(forwarding-headerSoup
+ COMMAND ${PERL_EXECUTABLE} ${WEBKIT2_DIR}/Scripts/generate-forwarding-headers.pl ${WEBKIT2_DIR} ${DERIVED_SOURCES_WEBKIT2_DIR}/include soup
+)
+SET(ForwardingNetworkHeaders_NAME forwarding-headerSoup)
diff --git a/Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp b/Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp
index be04bff26..866833c64 100644
--- a/Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp
+++ b/Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp
@@ -137,14 +137,14 @@ bool NetscapePluginModule::getPluginInfoForLoadedPlugin(PluginModuleInfo& plugin
char* buffer;
NPError error = NPP_GetValue(0, NPPVpluginNameString, &buffer);
if (error == NPERR_NO_ERROR)
- plugin.info.name = buffer;
+ plugin.info.name = String::fromUTF8(buffer);
error = NPP_GetValue(0, NPPVpluginDescriptionString, &buffer);
if (error == NPERR_NO_ERROR)
- plugin.info.desc = buffer;
+ plugin.info.desc = String::fromUTF8(buffer);
- const char* mimeDescription = NP_GetMIMEDescription();
- if (!mimeDescription)
+ String mimeDescription = String::fromUTF8(NP_GetMIMEDescription());
+ if (mimeDescription.isNull())
return false;
setMIMEDescription(mimeDescription, plugin);
diff --git a/Source/WebKit2/Shared/ShareableBitmap.h b/Source/WebKit2/Shared/ShareableBitmap.h
index c78a14e09..e5d1a6dc9 100644
--- a/Source/WebKit2/Shared/ShareableBitmap.h
+++ b/Source/WebKit2/Shared/ShareableBitmap.h
@@ -135,7 +135,7 @@ public:
// This creates a QImage that directly references the shared bitmap data.
// This is only safe to use when we know that the contents of the shareable bitmap won't change.
QImage createQImage();
- void swizzleRGB();
+ static void releaseSharedMemoryData(void* typelessBitmap);
#endif
private:
diff --git a/Source/WebKit2/Shared/WebPreferencesStore.h b/Source/WebKit2/Shared/WebPreferencesStore.h
index 0cdc97594..cb7030940 100644
--- a/Source/WebKit2/Shared/WebPreferencesStore.h
+++ b/Source/WebKit2/Shared/WebPreferencesStore.h
@@ -73,6 +73,7 @@ namespace WebKit {
macro(CompositingRepaintCountersVisible, compositingRepaintCountersVisible, Bool, bool, false) \
macro(CSSCustomFilterEnabled, cssCustomFilterEnabled, Bool, bool, true) \
macro(WebGLEnabled, webGLEnabled, Bool, bool, false) \
+ macro(CSSRegionsEnabled, cssRegionsEnabled, Bool, bool, true) \
macro(ForceFTPDirectoryListings, forceFTPDirectoryListings, Bool, bool, false) \
macro(TabsToLinks, tabsToLinks, Bool, bool, DEFAULT_WEBKIT_TABSTOLINKS_ENABLED) \
macro(DNSPrefetchingEnabled, dnsPrefetchingEnabled, Bool, bool, false) \
@@ -90,7 +91,7 @@ namespace WebKit {
macro(AllowUniversalAccessFromFileURLs, allowUniversalAccessFromFileURLs, Bool, bool, false) \
macro(AllowFileAccessFromFileURLs, allowFileAccessFromFileURLs, Bool, bool, false) \
macro(AVFoundationEnabled, isAVFoundationEnabled, Bool, bool, DEFAULT_WEBKIT_AVFOUNDATION_ENABLED) \
- macro(Hixie76WebSocketProtocolEnabled, hixie76WebSocketProtocolEnabled, Bool, bool, true) \
+ macro(Hixie76WebSocketProtocolEnabled, hixie76WebSocketProtocolEnabled, Bool, bool, false) \
macro(MediaPlaybackRequiresUserGesture, mediaPlaybackRequiresUserGesture, Bool, bool, false) \
macro(MediaPlaybackAllowsInline, mediaPlaybackAllowsInline, Bool, bool, true) \
macro(InspectorStartsAttached, inspectorStartsAttached, Bool, bool, true) \
@@ -98,7 +99,7 @@ namespace WebKit {
macro(MockScrollbarsEnabled, mockScrollbarsEnabled, Bool, bool, false) \
macro(WebAudioEnabled, webAudioEnabled, Bool, bool, false) \
macro(ApplicationChromeModeEnabled, applicationChromeMode, Bool, bool, false) \
- macro(SuppressIncrementalRendering, suppressIncrementalRendering, Bool, bool, false) \
+ macro(SuppressesIncrementalRendering, suppressesIncrementalRendering, Bool, bool, false) \
macro(BackspaceKeyNavigationEnabled, backspaceKeyNavigationEnabled, Bool, bool, true) \
macro(CaretBrowsingEnabled, caretBrowsingEnabled, Bool, bool, false) \
macro(ShouldDisplaySubtitles, shouldDisplaySubtitles, Bool, bool, false) \
diff --git a/Source/WebKit2/Shared/gtk/WebCoreArgumentCodersGtk.cpp b/Source/WebKit2/Shared/gtk/WebCoreArgumentCodersGtk.cpp
index aae59e340..9d6e25c66 100644
--- a/Source/WebKit2/Shared/gtk/WebCoreArgumentCodersGtk.cpp
+++ b/Source/WebKit2/Shared/gtk/WebCoreArgumentCodersGtk.cpp
@@ -99,6 +99,11 @@ bool ArgumentCoder<ResourceRequest>::decode(ArgumentDecoder* decoder, ResourceRe
void ArgumentCoder<ResourceResponse>::encode(ArgumentEncoder* encoder, const ResourceResponse& resourceResponse)
{
+ bool responseIsNull = resourceResponse.isNull();
+ encoder->encode(responseIsNull);
+ if (responseIsNull)
+ return;
+
encoder->encode(resourceResponse.url().string());
encoder->encode(static_cast<int32_t>(resourceResponse.httpStatusCode()));
@@ -115,6 +120,14 @@ void ArgumentCoder<ResourceResponse>::encode(ArgumentEncoder* encoder, const Res
bool ArgumentCoder<ResourceResponse>::decode(ArgumentDecoder* decoder, ResourceResponse& resourceResponse)
{
+ bool responseIsNull;
+ if (!decoder->decode(responseIsNull))
+ return false;
+ if (responseIsNull) {
+ resourceResponse = ResourceResponse();
+ return true;
+ }
+
ResourceResponse response;
String url;
@@ -170,6 +183,11 @@ bool ArgumentCoder<ResourceResponse>::decode(ArgumentDecoder* decoder, ResourceR
void ArgumentCoder<ResourceError>::encode(ArgumentEncoder* encoder, const ResourceError& resourceError)
{
+ bool errorIsNull = resourceError.isNull();
+ encoder->encode(errorIsNull);
+ if (errorIsNull)
+ return;
+
encoder->encode(resourceError.domain());
encoder->encode(resourceError.errorCode());
encoder->encode(resourceError.failingURL());
@@ -178,6 +196,14 @@ void ArgumentCoder<ResourceError>::encode(ArgumentEncoder* encoder, const Resour
bool ArgumentCoder<ResourceError>::decode(ArgumentDecoder* decoder, ResourceError& resourceError)
{
+ bool errorIsNull;
+ if (!decoder->decode(errorIsNull))
+ return false;
+ if (errorIsNull) {
+ resourceError = ResourceError();
+ return true;
+ }
+
String domain;
if (!decoder->decode(domain))
return false;
diff --git a/Source/WebKit2/Shared/qt/ShareableBitmapQt.cpp b/Source/WebKit2/Shared/qt/ShareableBitmapQt.cpp
index d5e371def..0c8be072a 100644
--- a/Source/WebKit2/Shared/qt/ShareableBitmapQt.cpp
+++ b/Source/WebKit2/Shared/qt/ShareableBitmapQt.cpp
@@ -38,8 +38,15 @@ namespace WebKit {
QImage ShareableBitmap::createQImage()
{
+ ref(); // Balanced by deref in releaseSharedMemoryData
return QImage(reinterpret_cast<uchar*>(data()), m_size.width(), m_size.height(), m_size.width() * 4,
- m_flags & SupportsAlpha ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32);
+ m_flags & SupportsAlpha ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32,
+ releaseSharedMemoryData, this);
+}
+
+void ShareableBitmap::releaseSharedMemoryData(void* typelessBitmap)
+{
+ static_cast<ShareableBitmap*>(typelessBitmap)->deref(); // Balanced by ref in createQImage.
}
PassRefPtr<Image> ShareableBitmap::createImage()
@@ -70,17 +77,5 @@ void ShareableBitmap::paint(GraphicsContext& /*context*/, float /*scaleFactor*/,
notImplemented();
}
-void ShareableBitmap::swizzleRGB()
-{
- uint32_t* data = reinterpret_cast<uint32_t*>(this->data());
- int width = size().width();
- int height = size().height();
- for (int y = 0; y < height; ++y) {
- uint32_t* p = data + y * width;
- for (int x = 0; x < width; ++x)
- p[x] = ((p[x] << 16) & 0xff0000) | ((p[x] >> 16) & 0xff) | (p[x] & 0xff00ff00);
- }
-}
-
}
// namespace WebKit
diff --git a/Source/WebKit2/Shared/qt/WebEventFactoryQt.cpp b/Source/WebKit2/Shared/qt/WebEventFactoryQt.cpp
index b6ac2f5e1..4eaff2c7e 100644
--- a/Source/WebKit2/Shared/qt/WebEventFactoryQt.cpp
+++ b/Source/WebKit2/Shared/qt/WebEventFactoryQt.cpp
@@ -86,6 +86,8 @@ static WebEvent::Type webEventTypeForEvent(const QEvent* event)
return WebEvent::TouchMove;
case QEvent::TouchEnd:
return WebEvent::TouchEnd;
+ case QEvent::TouchCancel:
+ return WebEvent::TouchCancel;
#endif
default:
// assert
@@ -207,6 +209,11 @@ WebTouchEvent WebEventFactory::createWebTouchEvent(const QTouchEvent* event, con
break;
}
+ // Qt does not have a Qt::TouchPointCancelled point state, so if we receive a touch cancel event,
+ // simply cancel all touch points here.
+ if (type == WebEvent::TouchCancel)
+ state = WebPlatformTouchPoint::TouchCancelled;
+
m_touchPoints.append(WebPlatformTouchPoint(id, state, touchPoint.screenPos().toPoint(), fromItemTransform.map(touchPoint.pos()).toPoint()));
}
diff --git a/Source/WebKit2/Target.pri b/Source/WebKit2/Target.pri
index 4326a4a99..2efe7f34c 100644
--- a/Source/WebKit2/Target.pri
+++ b/Source/WebKit2/Target.pri
@@ -12,7 +12,7 @@ load(features)
include(WebKit2.pri)
WEBKIT += wtf javascriptcore webcore
-QT += declarative quick widgets
+QT += declarative quick quick-private
CONFIG += staticlib
@@ -173,6 +173,7 @@ HEADERS += \
UIProcess/API/qt/qwebdownloaditem_p.h \
UIProcess/API/qt/qwebdownloaditem_p_p.h \
UIProcess/API/qt/qwebpermissionrequest_p.h \
+ UIProcess/API/qt/qtwebsecurityorigin_p.h \
UIProcess/API/qt/qwebnavigationrequest_p.h \
UIProcess/API/qt/qquickwebpage_p.h \
UIProcess/API/qt/qquickwebpage_p_p.h \
@@ -253,6 +254,7 @@ HEADERS += \
UIProcess/WebResourceCacheManagerProxy.h \
UIProcess/WebResourceLoadClient.h \
UIProcess/WebUIClient.h \
+ UIProcess/qt/LayerBackingStore.h \
UIProcess/qt/QtWebContext.h \
UIProcess/qt/QtWebPageEventHandler.h \
UIProcess/qt/QtGestureRecognizer.h \
@@ -266,6 +268,7 @@ HEADERS += \
UIProcess/qt/QtWebPageLoadClient.h \
UIProcess/qt/QtWebPagePolicyClient.h \
UIProcess/qt/QtWebPageUIClient.h \
+ UIProcess/qt/QtFlickProvider.h \
UIProcess/qt/QtViewportInteractionEngine.h \
UIProcess/qt/QtWebUndoController.h \
UIProcess/qt/QtWebIconDatabaseClient.h \
@@ -499,6 +502,7 @@ SOURCES += \
UIProcess/API/cpp/qt/WKURLQt.cpp \
UIProcess/API/qt/qwebdownloaditem.cpp \
UIProcess/API/qt/qwebpermissionrequest.cpp \
+ UIProcess/API/qt/qtwebsecurityorigin.cpp \
UIProcess/API/qt/qwebnavigationrequest.cpp \
UIProcess/API/qt/qquickwebpage.cpp \
UIProcess/API/qt/qwebnavigationhistory.cpp \
@@ -580,6 +584,7 @@ SOURCES += \
UIProcess/WebResourceLoadClient.cpp \
UIProcess/WebUIClient.cpp \
UIProcess/qt/QtWebContext.cpp \
+ UIProcess/qt/LayerBackingStore.cpp \
UIProcess/qt/LayerTreeHostProxyQt.cpp \
UIProcess/qt/QtWebPageEventHandler.cpp \
UIProcess/qt/QtGestureRecognizer.cpp \
@@ -594,6 +599,7 @@ SOURCES += \
UIProcess/qt/QtWebPagePolicyClient.cpp \
UIProcess/qt/QtWebPageUIClient.cpp \
UIProcess/qt/TextCheckerQt.cpp \
+ UIProcess/qt/QtFlickProvider.cpp \
UIProcess/qt/QtViewportInteractionEngine.cpp \
UIProcess/qt/WebContextMenuProxyQt.cpp \
UIProcess/qt/WebContextQt.cpp \
diff --git a/Source/WebKit2/UIProcess/API/C/WKInspector.cpp b/Source/WebKit2/UIProcess/API/C/WKInspector.cpp
index 325db5ae9..1a4ecc7c9 100644
--- a/Source/WebKit2/UIProcess/API/C/WKInspector.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKInspector.cpp
@@ -63,6 +63,16 @@ void WKInspectorShowConsole(WKInspectorRef inspectorRef)
toImpl(inspectorRef)->showConsole();
}
+void WKInspectorShowResources(WKInspectorRef inspectorRef)
+{
+ toImpl(inspectorRef)->showResources();
+}
+
+void WKInspectorShowMainResourceForFrame(WKInspectorRef inspectorRef, WKFrameRef frameRef)
+{
+ toImpl(inspectorRef)->showMainResourceForFrame(toImpl(frameRef));
+}
+
bool WKInspectorIsAttached(WKInspectorRef inspectorRef)
{
return toImpl(inspectorRef)->isAttached();
diff --git a/Source/WebKit2/UIProcess/API/C/WKInspector.h b/Source/WebKit2/UIProcess/API/C/WKInspector.h
index c147015f0..2e85688d0 100644
--- a/Source/WebKit2/UIProcess/API/C/WKInspector.h
+++ b/Source/WebKit2/UIProcess/API/C/WKInspector.h
@@ -47,6 +47,8 @@ WK_EXPORT void WKInspectorShow(WKInspectorRef inspector);
WK_EXPORT void WKInspectorClose(WKInspectorRef inspector);
WK_EXPORT void WKInspectorShowConsole(WKInspectorRef inspector);
+WK_EXPORT void WKInspectorShowResources(WKInspectorRef inspector);
+WK_EXPORT void WKInspectorShowMainResourceForFrame(WKInspectorRef inspector, WKFrameRef frame);
WK_EXPORT bool WKInspectorIsAttached(WKInspectorRef inspector);
WK_EXPORT void WKInspectorAttach(WKInspectorRef inspector);
diff --git a/Source/WebKit2/UIProcess/API/C/WKPage.h b/Source/WebKit2/UIProcess/API/C/WKPage.h
index ea8049dd5..96d097c60 100644
--- a/Source/WebKit2/UIProcess/API/C/WKPage.h
+++ b/Source/WebKit2/UIProcess/API/C/WKPage.h
@@ -71,6 +71,7 @@ typedef void (*WKPageDidChangeBackForwardListCallback)(WKPageRef page, WKBackFor
typedef bool (*WKPageShouldGoToBackForwardListItemCallback)(WKPageRef page, WKBackForwardListItemRef item, const void *clientInfo);
typedef void (*WKPageDidFailToInitializePluginCallback)(WKPageRef page, WKStringRef mimeType, const void* clientInfo);
typedef void (*WKPageDidNewFirstVisuallyNonEmptyLayoutCallback)(WKPageRef page, WKTypeRef userData, const void *clientInfo);
+typedef void (*WKPageWillGoToBackForwardListItemCallback)(WKPageRef page, WKBackForwardListItemRef item, const void *clientInfo);
struct WKPageLoaderClient {
int version;
@@ -110,6 +111,8 @@ struct WKPageLoaderClient {
// FIXME: didFirstVisuallyNonEmptyLayoutForFrame and didNewFirstVisuallyNonEmptyLayout should be merged.
WKPageDidNewFirstVisuallyNonEmptyLayoutCallback didNewFirstVisuallyNonEmptyLayout;
+
+ WKPageWillGoToBackForwardListItemCallback willGoToBackForwardListItem;
};
typedef struct WKPageLoaderClient WKPageLoaderClient;
diff --git a/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp b/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
index 521e6d4a0..87d32ed2f 100644
--- a/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
@@ -408,6 +408,16 @@ bool WKPreferencesGetWebGLEnabled(WKPreferencesRef preferencesRef)
return toImpl(preferencesRef)->webGLEnabled();
}
+void WKPreferencesSetCSSRegionsEnabled(WKPreferencesRef preferencesRef, bool flag)
+{
+ toImpl(preferencesRef)->setCSSRegionsEnabled(flag);
+}
+
+bool WKPreferencesGetCSSRegionsEnabled(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->cssRegionsEnabled();
+}
+
void WKPreferencesSetNeedsSiteSpecificQuirks(WKPreferencesRef preferencesRef, bool flag)
{
toImpl(preferencesRef)->setNeedsSiteSpecificQuirks(flag);
@@ -668,14 +678,14 @@ bool WKPreferencesGetApplicationChromeModeEnabled(WKPreferencesRef preferencesRe
return toImpl(preferencesRef)->applicationChromeMode();
}
-void WKPreferencesSetSuppressIncrementalRendering(WKPreferencesRef preferencesRef, bool enabled)
+void WKPreferencesSetSuppressesIncrementalRendering(WKPreferencesRef preferencesRef, bool enabled)
{
- toImpl(preferencesRef)->setSuppressIncrementalRendering(enabled);
+ toImpl(preferencesRef)->setSuppressesIncrementalRendering(enabled);
}
-bool WKPreferencesGetSuppressIncrementalRendering(WKPreferencesRef preferencesRef)
+bool WKPreferencesGetSuppressesIncrementalRendering(WKPreferencesRef preferencesRef)
{
- return toImpl(preferencesRef)->suppressIncrementalRendering();
+ return toImpl(preferencesRef)->suppressesIncrementalRendering();
}
void WKPreferencesSetBackspaceKeyNavigationEnabled(WKPreferencesRef preferencesRef, bool enabled)
diff --git a/Source/WebKit2/UIProcess/API/C/WKPreferences.h b/Source/WebKit2/UIProcess/API/C/WKPreferences.h
index f13559acb..8054e00f3 100644
--- a/Source/WebKit2/UIProcess/API/C/WKPreferences.h
+++ b/Source/WebKit2/UIProcess/API/C/WKPreferences.h
@@ -170,8 +170,8 @@ WK_EXPORT void WKPreferencesSetWebAudioEnabled(WKPreferencesRef preferencesRef,
WK_EXPORT bool WKPreferencesGetWebAudioEnabled(WKPreferencesRef preferencesRef);
// Defaults to false
-WK_EXPORT void WKPreferencesSetSuppressIncrementalRendering(WKPreferencesRef preferencesRef, bool enabled);
-WK_EXPORT bool WKPreferencesGetSuppressIncrementalRendering(WKPreferencesRef preferencesRef);
+WK_EXPORT void WKPreferencesSetSuppressesIncrementalRendering(WKPreferencesRef preferencesRef, bool enabled);
+WK_EXPORT bool WKPreferencesGetSuppressesIncrementalRendering(WKPreferencesRef preferencesRef);
// Defaults to true
WK_EXPORT void WKPreferencesSetBackspaceKeyNavigationEnabled(WKPreferencesRef preferencesRef, bool enabled);
diff --git a/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h b/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h
index 9153ccab8..36950e891 100644
--- a/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h
+++ b/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h
@@ -91,6 +91,10 @@ WK_EXPORT bool WKPreferencesGetCSSCustomFilterEnabled(WKPreferencesRef);
WK_EXPORT void WKPreferencesSetWebGLEnabled(WKPreferencesRef, bool);
WK_EXPORT bool WKPreferencesGetWebGLEnabled(WKPreferencesRef);
+// Defaults to true
+WK_EXPORT void WKPreferencesSetCSSRegionsEnabled(WKPreferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetCSSRegionsEnabled(WKPreferencesRef);
+
// Defaults to false.
WK_EXPORT void WKPreferencesSetNeedsSiteSpecificQuirks(WKPreferencesRef, bool);
WK_EXPORT bool WKPreferencesGetNeedsSiteSpecificQuirks(WKPreferencesRef);
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitDefines.h b/Source/WebKit2/UIProcess/API/gtk/WebKitDefines.h
index 79b338360..8c3eec2a4 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitDefines.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitDefines.h
@@ -32,6 +32,8 @@
#include <glib.h>
+typedef struct _WebKitPrintOperation WebKitPrintOperation;
+
#ifdef G_OS_WIN32
# ifdef BUILDING_WEBKIT
# define WEBKIT_API __declspec(dllexport)
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.cpp
new file mode 100644
index 000000000..928b4dc42
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.cpp
@@ -0,0 +1,430 @@
+/*
+ * Copyright (C) 2012 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "WebKitHitTestResult.h"
+
+#include "WebHitTestResult.h"
+#include "WebKitHitTestResultPrivate.h"
+#include <glib/gi18n-lib.h>
+#include <wtf/text/CString.h>
+
+/**
+ * SECTION: WebKitHitTestResult
+ * @Short_description: Result of a Hit Test
+ * @Title: WebKitHitTestResult
+ * @See_also: #WebKitWebView
+ *
+ * A Hit Test is an operation to get context information about a given
+ * point in a #WebKitWebView. #WebKitHitTestResult represents the
+ * result of a Hit Test. It provides context information about what is
+ * at the coordinates of the Hit Test, such as if there's a link,
+ * an image or a media.
+ *
+ * You can get the context of the HitTestResult with
+ * webkit_hit_test_result_get_context() that returns a bitmask of
+ * #WebKitHitTestResultContext flags. You can also use
+ * webkit_hit_test_result_context_is_link(), webkit_hit_test_result_context_is_image() and
+ * webkit_hit_test_result_context_is_media() to determine whether there's
+ * a link, image or a media element at the coordinates of the Hit Test.
+ * Note that it's possible that several #WebKitHitTestResultContext flags
+ * are active at the same time, for example if there's a link containing an image.
+ *
+ * When the mouse is moved over a #WebKitWebView a Hit Test is performed
+ * for the mouse coordinates and #WebKitWebView::mouse-target-changed
+ * signal is emitted with a #WebKitHitTestResult.
+ *
+ */
+
+using namespace WebKit;
+
+enum {
+ PROP_0,
+
+ PROP_CONTEXT,
+ PROP_LINK_URI,
+ PROP_LINK_TITLE,
+ PROP_LINK_LABEL,
+ PROP_IMAGE_URI,
+ PROP_MEDIA_URI
+};
+
+struct _WebKitHitTestResultPrivate {
+ unsigned int context;
+ CString linkURI;
+ CString linkTitle;
+ CString linkLabel;
+ CString imageURI;
+ CString mediaURI;
+};
+
+G_DEFINE_TYPE(WebKitHitTestResult, webkit_hit_test_result, G_TYPE_OBJECT)
+
+static void webkitHitTestResultFinalize(GObject* object)
+{
+ WEBKIT_HIT_TEST_RESULT(object)->priv->~WebKitHitTestResultPrivate();
+ G_OBJECT_CLASS(webkit_hit_test_result_parent_class)->finalize(object);
+}
+
+static void webkitHitTestResultGetProperty(GObject* object, guint propId, GValue* value, GParamSpec* paramSpec)
+{
+ WebKitHitTestResult* hitTestResult = WEBKIT_HIT_TEST_RESULT(object);
+
+ switch (propId) {
+ case PROP_CONTEXT:
+ g_value_set_uint(value, webkit_hit_test_result_get_context(hitTestResult));
+ break;
+ case PROP_LINK_URI:
+ g_value_set_string(value, webkit_hit_test_result_get_link_uri(hitTestResult));
+ break;
+ case PROP_LINK_TITLE:
+ g_value_set_string(value, webkit_hit_test_result_get_link_title(hitTestResult));
+ break;
+ case PROP_LINK_LABEL:
+ g_value_set_string(value, webkit_hit_test_result_get_link_label(hitTestResult));
+ break;
+ case PROP_IMAGE_URI:
+ g_value_set_string(value, webkit_hit_test_result_get_image_uri(hitTestResult));
+ break;
+ case PROP_MEDIA_URI:
+ g_value_set_string(value, webkit_hit_test_result_get_media_uri(hitTestResult));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, paramSpec);
+ }
+}
+
+static void webkitHitTestResultSetProperty(GObject* object, guint propId, const GValue* value, GParamSpec* paramSpec)
+{
+ WebKitHitTestResult* hitTestResult = WEBKIT_HIT_TEST_RESULT(object);
+
+ switch (propId) {
+ case PROP_CONTEXT:
+ hitTestResult->priv->context = g_value_get_uint(value);
+ break;
+ case PROP_LINK_URI:
+ hitTestResult->priv->linkURI = g_value_get_string(value);
+ break;
+ case PROP_LINK_TITLE:
+ hitTestResult->priv->linkTitle = g_value_get_string(value);
+ break;
+ case PROP_LINK_LABEL:
+ hitTestResult->priv->linkLabel = g_value_get_string(value);
+ break;
+ case PROP_IMAGE_URI:
+ hitTestResult->priv->imageURI = g_value_get_string(value);
+ break;
+ case PROP_MEDIA_URI:
+ hitTestResult->priv->mediaURI = g_value_get_string(value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, paramSpec);
+ }
+}
+
+static void webkit_hit_test_result_init(WebKitHitTestResult* hitTestResult)
+{
+ WebKitHitTestResultPrivate* priv = G_TYPE_INSTANCE_GET_PRIVATE(hitTestResult, WEBKIT_TYPE_HIT_TEST_RESULT, WebKitHitTestResultPrivate);
+ hitTestResult->priv = priv;
+ new (priv) WebKitHitTestResultPrivate();
+}
+
+static void webkit_hit_test_result_class_init(WebKitHitTestResultClass* hitTestResultClass)
+{
+ GObjectClass* objectClass = G_OBJECT_CLASS(hitTestResultClass);
+ objectClass->get_property = webkitHitTestResultGetProperty;
+ objectClass->set_property = webkitHitTestResultSetProperty;
+ objectClass->finalize = webkitHitTestResultFinalize;
+
+ GParamFlags paramFlags = static_cast<GParamFlags>(WEBKIT_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
+
+ /**
+ * WebKitHitTestResult:context:
+ *
+ * Bitmask of #WebKitHitTestResultContext flags representing
+ * the context of the #WebKitHitTestResult.
+ */
+ g_object_class_install_property(objectClass,
+ PROP_CONTEXT,
+ g_param_spec_uint("context",
+ _("Context"),
+ _("Flags with the context of the WebKitHitTestResult"),
+ 0, G_MAXUINT, 0,
+ paramFlags));
+
+ /**
+ * WebKitHitTestResult:link-uri:
+ *
+ * The URI of the link if flag %WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK
+ * is present in #WebKitHitTestResult:context
+ */
+ g_object_class_install_property(objectClass,
+ PROP_LINK_URI,
+ g_param_spec_string("link-uri",
+ _("Link URI"),
+ _("The link URI"),
+ 0,
+ paramFlags));
+ /**
+ * WebKitHitTestResult:link-title:
+ *
+ * The title of the link if flag %WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK
+ * is present in #WebKitHitTestResult:context
+ */
+ g_object_class_install_property(objectClass,
+ PROP_LINK_TITLE,
+ g_param_spec_string("link-title",
+ _("Link Title"),
+ _("The link title"),
+ 0,
+ paramFlags));
+ /**
+ * WebKitHitTestResult:link-label:
+ *
+ * The label of the link if flag %WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK
+ * is present in #WebKitHitTestResult:context
+ */
+ g_object_class_install_property(objectClass,
+ PROP_LINK_LABEL,
+ g_param_spec_string("link-label",
+ _("Link Label"),
+ _("The link label"),
+ 0,
+ paramFlags));
+ /**
+ * WebKitHitTestResult:image-uri:
+ *
+ * The URI of the image if flag %WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE
+ * is present in #WebKitHitTestResult:context
+ */
+ g_object_class_install_property(objectClass,
+ PROP_IMAGE_URI,
+ g_param_spec_string("image-uri",
+ _("Image URI"),
+ _("The image URI"),
+ 0,
+ paramFlags));
+ /**
+ * WebKitHitTestResult:media-uri:
+ *
+ * The URI of the media if flag %WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA
+ * is present in #WebKitHitTestResult:context
+ */
+ g_object_class_install_property(objectClass,
+ PROP_MEDIA_URI,
+ g_param_spec_string("media-uri",
+ _("Media URI"),
+ _("The media URI"),
+ 0,
+ paramFlags));
+
+ g_type_class_add_private(hitTestResultClass, sizeof(WebKitHitTestResultPrivate));
+}
+
+WebKitHitTestResult* webkitHitTestResultCreate(WKHitTestResultRef wkHitTestResult)
+{
+ unsigned context = WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT;
+
+ const String& linkURL = toImpl(wkHitTestResult)->absoluteLinkURL();
+ if (!linkURL.isEmpty())
+ context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK;
+
+ const String& imageURL = toImpl(wkHitTestResult)->absoluteImageURL();
+ if (!imageURL.isEmpty())
+ context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE;
+
+ const String& mediaURL = toImpl(wkHitTestResult)->absoluteMediaURL();
+ if (!mediaURL.isEmpty())
+ context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA;
+
+ const String& linkTitle = toImpl(wkHitTestResult)->linkTitle();
+ const String& linkLabel = toImpl(wkHitTestResult)->linkLabel();
+
+ return WEBKIT_HIT_TEST_RESULT(g_object_new(WEBKIT_TYPE_HIT_TEST_RESULT,
+ "context", context,
+ "link-uri", !linkURL.isEmpty() ? linkURL.utf8().data() : 0,
+ "image-uri", !imageURL.isEmpty() ? imageURL.utf8().data() : 0,
+ "media-uri", !mediaURL.isEmpty() ? mediaURL.utf8().data() : 0,
+ "link-title", !linkTitle.isEmpty() ? linkTitle.utf8().data() : 0,
+ "link-label", !linkLabel.isEmpty() ? linkLabel.utf8().data() : 0,
+ NULL));
+}
+
+static bool stringIsEqualToCString(const String& string, const CString& cString)
+{
+ return ((string.isEmpty() && cString.isNull()) || (string.utf8() == cString));
+}
+
+bool webkitHitTestResultCompare(WebKitHitTestResult* hitTestResult, WKHitTestResultRef wkHitTestResult)
+{
+ WebKitHitTestResultPrivate* priv = hitTestResult->priv;
+ return stringIsEqualToCString(toImpl(wkHitTestResult)->absoluteLinkURL(), priv->linkURI)
+ && stringIsEqualToCString(toImpl(wkHitTestResult)->linkTitle(), priv->linkTitle)
+ && stringIsEqualToCString(toImpl(wkHitTestResult)->linkLabel(), priv->linkLabel)
+ && stringIsEqualToCString(toImpl(wkHitTestResult)->absoluteImageURL(), priv->imageURI)
+ && stringIsEqualToCString(toImpl(wkHitTestResult)->absoluteMediaURL(), priv->mediaURI);
+}
+
+/**
+ * webkit_hit_test_result_get_context:
+ * @hit_test_result: a #WebKitHitTestResult
+ *
+ * Gets the value of the #WebKitHitTestResult:context property.
+ *
+ * Returns: a bitmask of #WebKitHitTestResultContext flags
+ */
+guint webkit_hit_test_result_get_context(WebKitHitTestResult* hitTestResult)
+{
+ g_return_val_if_fail(WEBKIT_IS_HIT_TEST_RESULT(hitTestResult), 0);
+
+ return hitTestResult->priv->context;
+}
+
+/**
+ * webkit_hit_test_result_context_is_link:
+ * @hit_test_result: a #WebKitHitTestResult
+ *
+ * Gets whether %WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK flag is present in
+ * #WebKitHitTestResult:context.
+ *
+ * Returns: %TRUE if there's a link element in the coordinates of the Hit Test,
+ * or %FALSE otherwise
+ */
+gboolean webkit_hit_test_result_context_is_link(WebKitHitTestResult* hitTestResult)
+{
+ g_return_val_if_fail(WEBKIT_IS_HIT_TEST_RESULT(hitTestResult), FALSE);
+
+ return hitTestResult->priv->context & WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK;
+}
+
+/**
+ * webkit_hit_test_result_context_is_image:
+ * @hit_test_result: a #WebKitHitTestResult
+ *
+ * Gets whether %WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE flag is present in
+ * #WebKitHitTestResult:context.
+ *
+ * Returns: %TRUE if there's an image element in the coordinates of the Hit Test,
+ * or %FALSE otherwise
+ */
+gboolean webkit_hit_test_result_context_is_image(WebKitHitTestResult* hitTestResult)
+{
+ g_return_val_if_fail(WEBKIT_IS_HIT_TEST_RESULT(hitTestResult), FALSE);
+
+ return hitTestResult->priv->context & WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE;
+}
+
+/**
+ * webkit_hit_test_result_context_is_media:
+ * @hit_test_result: a #WebKitHitTestResult
+ *
+ * Gets whether %WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA flag is present in
+ * #WebKitHitTestResult:context.
+ *
+ * Returns: %TRUE if there's a media element in the coordinates of the Hit Test,
+ * or %FALSE otherwise
+ */
+gboolean webkit_hit_test_result_context_is_media(WebKitHitTestResult* hitTestResult)
+{
+ g_return_val_if_fail(WEBKIT_IS_HIT_TEST_RESULT(hitTestResult), FALSE);
+
+ return hitTestResult->priv->context & WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA;
+}
+
+/**
+ * webkit_hit_test_result_get_link_uri:
+ * @hit_test_result: a #WebKitHitTestResult
+ *
+ * Gets the value of the #WebKitHitTestResult:link-uri property.
+ *
+ * Returns: the URI of the link element in the coordinates of the Hit Test,
+ * or %NULL if there ins't a link element in @hit_test_result context
+ */
+const gchar* webkit_hit_test_result_get_link_uri(WebKitHitTestResult* hitTestResult)
+{
+ g_return_val_if_fail(WEBKIT_IS_HIT_TEST_RESULT(hitTestResult), 0);
+
+ return hitTestResult->priv->linkURI.data();
+}
+
+/**
+ * webkit_hit_test_result_get_link_title:
+ * @hit_test_result: a #WebKitHitTestResult
+ *
+ * Gets the value of the #WebKitHitTestResult:link-title property.
+ *
+ * Returns: the title of the link element in the coordinates of the Hit Test,
+ * or %NULL if there ins't a link element in @hit_test_result context or the
+ * link element doesn't have a title
+ */
+const gchar* webkit_hit_test_result_get_link_title(WebKitHitTestResult* hitTestResult)
+{
+ g_return_val_if_fail(WEBKIT_IS_HIT_TEST_RESULT(hitTestResult), 0);
+
+ return hitTestResult->priv->linkTitle.data();
+}
+
+/**
+ * webkit_hit_test_result_get_link_label:
+ * @hit_test_result: a #WebKitHitTestResult
+ *
+ * Gets the value of the #WebKitHitTestResult:link-label property.
+ *
+ * Returns: the label of the link element in the coordinates of the Hit Test,
+ * or %NULL if there ins't a link element in @hit_test_result context or the
+ * link element doesn't have a label
+ */
+const gchar* webkit_hit_test_result_get_link_label(WebKitHitTestResult* hitTestResult)
+{
+ g_return_val_if_fail(WEBKIT_IS_HIT_TEST_RESULT(hitTestResult), 0);
+
+ return hitTestResult->priv->linkLabel.data();
+}
+
+/**
+ * webkit_hit_test_result_get_image_uri:
+ * @hit_test_result: a #WebKitHitTestResult
+ *
+ * Gets the value of the #WebKitHitTestResult:image-uri property.
+ *
+ * Returns: the URI of the image element in the coordinates of the Hit Test,
+ * or %NULL if there ins't an image element in @hit_test_result context
+ */
+const gchar* webkit_hit_test_result_get_image_uri(WebKitHitTestResult* hitTestResult)
+{
+ g_return_val_if_fail(WEBKIT_IS_HIT_TEST_RESULT(hitTestResult), 0);
+
+ return hitTestResult->priv->imageURI.data();
+}
+
+/**
+ * webkit_hit_test_result_get_media_uri:
+ * @hit_test_result: a #WebKitHitTestResult
+ *
+ * Gets the value of the #WebKitHitTestResult:media-uri property.
+ *
+ * Returns: the URI of the media element in the coordinates of the Hit Test,
+ * or %NULL if there ins't a media element in @hit_test_result context
+ */
+const gchar* webkit_hit_test_result_get_media_uri(WebKitHitTestResult* hitTestResult)
+{
+ g_return_val_if_fail(WEBKIT_IS_HIT_TEST_RESULT(hitTestResult), 0);
+
+ return hitTestResult->priv->mediaURI.data();
+}
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.h b/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.h
new file mode 100644
index 000000000..d8916e5f3
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.h
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2012 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#if !defined(__WEBKIT2_H_INSIDE__) && !defined(WEBKIT2_COMPILATION)
+#error "Only <webkit2/webkit2.h> can be included directly."
+#endif
+
+#ifndef WebKitHitTestResult_h
+#define WebKitHitTestResult_h
+
+#include <glib-object.h>
+#include <webkit2/WebKitDefines.h>
+
+G_BEGIN_DECLS
+
+#define WEBKIT_TYPE_HIT_TEST_RESULT (webkit_hit_test_result_get_type())
+#define WEBKIT_HIT_TEST_RESULT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_HIT_TEST_RESULT, WebKitHitTestResult))
+#define WEBKIT_IS_HIT_TEST_RESULT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_HIT_TEST_RESULT))
+#define WEBKIT_HIT_TEST_RESULT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_HIT_TEST_RESULT, WebKitHitTestResultClass))
+#define WEBKIT_IS_HIT_TEST_RESULT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_HIT_TEST_RESULT))
+#define WEBKIT_HIT_TEST_RESULT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_HIT_TEST_RESULT, WebKitHitTestResultClass))
+
+typedef struct _WebKitHitTestResult WebKitHitTestResult;
+typedef struct _WebKitHitTestResultClass WebKitHitTestResultClass;
+typedef struct _WebKitHitTestResultPrivate WebKitHitTestResultPrivate;
+
+/**
+ * WebKitHitTestResultContext:
+ * @WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT: anywhere in the document.
+ * @WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK: a hyperlink element.
+ * @WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE: an image element.
+ * @WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA: a video or audio element.
+ *
+ * Enum values with flags representing the context of a #WebKitHitTestResult.
+ */
+typedef enum
+{
+ WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT = 1 << 1,
+ WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK = 1 << 2,
+ WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE = 1 << 3,
+ WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA = 1 << 4
+} WebKitHitTestResultContext;
+
+struct _WebKitHitTestResult {
+ GObject parent;
+
+ WebKitHitTestResultPrivate *priv;
+};
+
+struct _WebKitHitTestResultClass {
+ GObjectClass parent_class;
+};
+
+WEBKIT_API GType
+webkit_hit_test_result_get_type (void);
+
+WEBKIT_API guint
+webkit_hit_test_result_get_context (WebKitHitTestResult *hit_test_result);
+
+WEBKIT_API gboolean
+webkit_hit_test_result_context_is_link (WebKitHitTestResult *hit_test_result);
+
+WEBKIT_API gboolean
+webkit_hit_test_result_context_is_image (WebKitHitTestResult *hit_test_result);
+
+WEBKIT_API gboolean
+webkit_hit_test_result_context_is_media (WebKitHitTestResult *hit_test_result);
+
+WEBKIT_API const gchar *
+webkit_hit_test_result_get_link_uri (WebKitHitTestResult *hit_test_result);
+
+WEBKIT_API const gchar *
+webkit_hit_test_result_get_link_title (WebKitHitTestResult *hit_test_result);
+
+WEBKIT_API const gchar *
+webkit_hit_test_result_get_link_label (WebKitHitTestResult *hit_test_result);
+
+WEBKIT_API const gchar *
+webkit_hit_test_result_get_image_uri (WebKitHitTestResult *hit_test_result);
+
+WEBKIT_API const gchar *
+webkit_hit_test_result_get_media_uri (WebKitHitTestResult *hit_test_result);
+
+G_END_DECLS
+
+#endif
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResultPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResultPrivate.h
new file mode 100644
index 000000000..6088006e7
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResultPrivate.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2012 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef WebKitHitTestResultPrivate_h
+#define WebKitHitTestResultPrivate_h
+
+#include "WebKitHitTestResult.h"
+#include "WebKitPrivate.h"
+
+WebKitHitTestResult* webkitHitTestResultCreate(WKHitTestResultRef);
+bool webkitHitTestResultCompare(WebKitHitTestResult*, WKHitTestResultRef);
+
+#endif // WebKitHitTestResultPrivate_h
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp
index 6d1133941..c26d8ebe9 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp
@@ -144,7 +144,8 @@ void attachLoaderClientToView(WebKitWebView* webView)
didChangeBackForwardList,
0, // shouldGoToBackForwardListItem
0, // didFailToInitializePlugin
- 0 // didDetectXSSForFrame
+ 0, // didDetectXSSForFrame
+ 0 // didFirstVisuallyNonEmptyLayoutForFrame
};
WKPageRef wkPage = toAPI(webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView)));
WKPageSetPageLoaderClient(wkPage, &wkLoaderClient);
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp
index fcd57b4a6..94d13eab2 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp
@@ -25,7 +25,6 @@
#include "WebKitPrivate.h"
#include "WebKitURIRequestPrivate.h"
#include "WebURLRequest.h"
-#include <gdk/gdk.h>
#include <glib/gi18n-lib.h>
#include <wtf/gobject/GRefPtr.h>
#include <wtf/text/CString.h>
@@ -280,26 +279,12 @@ static unsigned wkEventMouseButtonToWebKitMouseButton(WKEventMouseButton wkButto
return 0;
}
-unsigned wkEventModifiersToUnsigned(WKEventModifiers wkModifiers)
-{
- unsigned modifiers = 0;
- if (wkModifiers & kWKEventModifiersShiftKey)
- modifiers |= GDK_SHIFT_MASK;
- if (wkModifiers & kWKEventModifiersControlKey)
- modifiers |= GDK_CONTROL_MASK;
- if (wkModifiers & kWKEventModifiersAltKey)
- modifiers |= GDK_MOD1_MASK;
- if (wkModifiers & kWKEventModifiersMetaKey)
- modifiers |= GDK_META_MASK;
- return modifiers;
-}
-
WebKitNavigationPolicyDecision* webkitNavigationPolicyDecisionCreate(WKFrameNavigationType navigationType, WKEventMouseButton mouseButton, WKEventModifiers modifiers, WKURLRequestRef request, const char* frameName, WKFramePolicyListenerRef listener)
{
WebKitNavigationPolicyDecision* decision = WEBKIT_NAVIGATION_POLICY_DECISION(g_object_new(WEBKIT_TYPE_NAVIGATION_POLICY_DECISION, NULL));
decision->priv->navigationType = static_cast<WebKitNavigationType>(navigationType);
decision->priv->mouseButton = wkEventMouseButtonToWebKitMouseButton(mouseButton);
- decision->priv->modifiers = wkEventModifiersToUnsigned(modifiers);
+ decision->priv->modifiers = wkEventModifiersToGdkModifiers(modifiers);
decision->priv->request = adoptGRef(webkitURIRequestCreateForResourceRequest(toImpl(request)->resourceRequest()));
decision->priv->frameName = frameName;
webkitPolicyDecisionSetListener(WEBKIT_POLICY_DECISION(decision), listener);
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperation.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperation.cpp
new file mode 100644
index 000000000..a20ccb2a6
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperation.cpp
@@ -0,0 +1,410 @@
+/*
+ * Copyright (C) 2012 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "WebKitPrintOperation.h"
+
+#include "PrintInfo.h"
+#include "WebKitPrintOperationPrivate.h"
+#include "WebKitPrivate.h"
+#include "WebKitWebViewBasePrivate.h"
+#include "WebPageProxy.h"
+#include <WebCore/GtkUtilities.h>
+#include <WebCore/NotImplemented.h>
+#include <glib/gi18n-lib.h>
+#include <wtf/gobject/GRefPtr.h>
+
+#ifdef HAVE_GTK_UNIX_PRINTING
+#include <gtk/gtkunixprint.h>
+#endif
+
+using namespace WebKit;
+
+enum {
+ PROP_0,
+
+ PROP_WEB_VIEW,
+ PROP_PRINT_SETTINGS,
+ PROP_PAGE_SETUP
+};
+
+enum {
+ FINISHED,
+
+ LAST_SIGNAL
+};
+
+struct _WebKitPrintOperationPrivate {
+ WebKitWebView* webView;
+ gulong webViewDestroyedId;
+
+ GRefPtr<GtkPrintSettings> printSettings;
+ GRefPtr<GtkPageSetup> pageSetup;
+};
+
+static guint signals[LAST_SIGNAL] = { 0, };
+
+G_DEFINE_TYPE(WebKitPrintOperation, webkit_print_operation, G_TYPE_OBJECT)
+
+static void webkitPrintOperationFinalize(GObject* object)
+{
+ WebKitPrintOperationPrivate* priv = WEBKIT_PRINT_OPERATION(object)->priv;
+ g_signal_handler_disconnect(priv->webView, priv->webViewDestroyedId);
+
+ priv->~WebKitPrintOperationPrivate();
+ G_OBJECT_CLASS(webkit_print_operation_parent_class)->finalize(object);
+}
+
+static void webViewDestroyed(GtkWidget* webView, GObject* printOperation)
+{
+ g_object_unref(printOperation);
+}
+
+static void webkitPrintOperationConstructed(GObject* object)
+{
+ WebKitPrintOperation* printOperation = WEBKIT_PRINT_OPERATION(object);
+ WebKitPrintOperationPrivate* priv = printOperation->priv;
+
+ if (G_OBJECT_CLASS(webkit_print_operation_parent_class)->constructed)
+ G_OBJECT_CLASS(webkit_print_operation_parent_class)->constructed(object);
+
+ priv->webViewDestroyedId = g_signal_connect(priv->webView, "destroy", G_CALLBACK(webViewDestroyed), printOperation);
+}
+
+static void webkitPrintOperationGetProperty(GObject* object, guint propId, GValue* value, GParamSpec* paramSpec)
+{
+ WebKitPrintOperation* printOperation = WEBKIT_PRINT_OPERATION(object);
+
+ switch (propId) {
+ case PROP_WEB_VIEW:
+ g_value_take_object(value, printOperation->priv->webView);
+ break;
+ case PROP_PRINT_SETTINGS:
+ g_value_set_object(value, printOperation->priv->printSettings.get());
+ break;
+ case PROP_PAGE_SETUP:
+ g_value_set_object(value, printOperation->priv->pageSetup.get());
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, paramSpec);
+ }
+}
+
+static void webkitPrintOperationSetProperty(GObject* object, guint propId, const GValue* value, GParamSpec* paramSpec)
+{
+ WebKitPrintOperation* printOperation = WEBKIT_PRINT_OPERATION(object);
+
+ switch (propId) {
+ case PROP_WEB_VIEW:
+ printOperation->priv->webView = WEBKIT_WEB_VIEW(g_value_get_object(value));
+ break;
+ case PROP_PRINT_SETTINGS:
+ webkit_print_operation_set_print_settings(printOperation, GTK_PRINT_SETTINGS(g_value_get_object(value)));
+ break;
+ case PROP_PAGE_SETUP:
+ webkit_print_operation_set_page_setup(printOperation, GTK_PAGE_SETUP(g_value_get_object(value)));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, paramSpec);
+ }
+}
+
+static void webkit_print_operation_init(WebKitPrintOperation* printOperation)
+{
+ WebKitPrintOperationPrivate* priv = G_TYPE_INSTANCE_GET_PRIVATE(printOperation, WEBKIT_TYPE_PRINT_OPERATION, WebKitPrintOperationPrivate);
+ printOperation->priv = priv;
+ new (priv) WebKitPrintOperationPrivate();
+}
+
+static void webkit_print_operation_class_init(WebKitPrintOperationClass* printOperationClass)
+{
+ GObjectClass* gObjectClass = G_OBJECT_CLASS(printOperationClass);
+ gObjectClass->finalize = webkitPrintOperationFinalize;
+ gObjectClass->constructed = webkitPrintOperationConstructed;
+ gObjectClass->get_property = webkitPrintOperationGetProperty;
+ gObjectClass->set_property = webkitPrintOperationSetProperty;
+
+ /**
+ * WebKitPrintOperation:web-view:
+ *
+ * The #WebKitWebView that will be printed.
+ */
+ g_object_class_install_property(gObjectClass,
+ PROP_WEB_VIEW,
+ g_param_spec_object("web-view",
+ _("Web View"),
+ _("The web view that will be printed"),
+ WEBKIT_TYPE_WEB_VIEW,
+ static_cast<GParamFlags>(WEBKIT_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)));
+
+ /**
+ * WebKitPrintOperation:print-settings:
+ *
+ * The initial #GtkPrintSettings for the print operation.
+ */
+ g_object_class_install_property(gObjectClass,
+ PROP_PRINT_SETTINGS,
+ g_param_spec_object("print-settings",
+ _("Print Settings"),
+ _("The initial print settings for the print operation"),
+ GTK_TYPE_PRINT_SETTINGS,
+ WEBKIT_PARAM_READWRITE));
+ /**
+ * WebKitPrintOperation:page-setup:
+ *
+ * The initial #GtkPageSetup for the print operation.
+ */
+ g_object_class_install_property(gObjectClass,
+ PROP_PAGE_SETUP,
+ g_param_spec_object("page-setup",
+ _("Page Setup"),
+ _("The initial page setup for the print operation"),
+ GTK_TYPE_PAGE_SETUP,
+ WEBKIT_PARAM_READWRITE));
+
+ /**
+ * WebKitPrintOperation::finished:
+ * @print_operation: the #WebKitPrintOperation on which the signal was emitted
+ *
+ * Emitted when the print operation has finished doing everything
+ * required for printing.
+ */
+ signals[FINISHED] =
+ g_signal_new("finished",
+ G_TYPE_FROM_CLASS(gObjectClass),
+ G_SIGNAL_RUN_LAST,
+ 0, 0, 0,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ g_type_class_add_private(printOperationClass, sizeof(WebKitPrintOperationPrivate));
+}
+
+#ifdef HAVE_GTK_UNIX_PRINTING
+static WebKitPrintOperationResponse webkitPrintOperationRunDialog(WebKitPrintOperation* printOperation, GtkWindow* parent)
+{
+ GtkPrintUnixDialog* printDialog = GTK_PRINT_UNIX_DIALOG(gtk_print_unix_dialog_new(0, parent));
+ gtk_print_unix_dialog_set_manual_capabilities(printDialog, static_cast<GtkPrintCapabilities>(GTK_PRINT_CAPABILITY_NUMBER_UP
+ | GTK_PRINT_CAPABILITY_NUMBER_UP_LAYOUT
+ | GTK_PRINT_CAPABILITY_PAGE_SET
+ | GTK_PRINT_CAPABILITY_REVERSE
+ | GTK_PRINT_CAPABILITY_COPIES
+ | GTK_PRINT_CAPABILITY_COLLATE
+ | GTK_PRINT_CAPABILITY_SCALE));
+
+ WebKitPrintOperationPrivate* priv = printOperation->priv;
+ if (priv->printSettings)
+ gtk_print_unix_dialog_set_settings(printDialog, priv->printSettings.get());
+
+ if (priv->pageSetup)
+ gtk_print_unix_dialog_set_page_setup(printDialog, priv->pageSetup.get());
+
+ gtk_print_unix_dialog_set_embed_page_setup(printDialog, TRUE);
+
+ WebKitPrintOperationResponse returnValue = WEBKIT_PRINT_OPERATION_RESPONSE_CANCEL;
+ if (gtk_dialog_run(GTK_DIALOG(printDialog)) == GTK_RESPONSE_OK) {
+ priv->printSettings = adoptGRef(gtk_print_unix_dialog_get_settings(printDialog));
+ priv->pageSetup = gtk_print_unix_dialog_get_page_setup(printDialog);
+ returnValue = WEBKIT_PRINT_OPERATION_RESPONSE_PRINT;
+ }
+
+ gtk_widget_destroy(GTK_WIDGET(printDialog));
+
+ return returnValue;
+}
+#else
+// TODO: We need to add an implementation for Windows.
+static WebKitPrintOperationResponse webkitPrintOperationRunDialog(WebKitPrintOperation*, GtkWindow*)
+{
+ notImplemented();
+ return WEBKIT_PRINT_OPERATION_RESPONSE_CANCEL;
+}
+#endif
+
+static void drawPagesForPrintingCompleted(WKErrorRef, void* context)
+{
+ GRefPtr<WebKitPrintOperation> printOperation = adoptGRef(WEBKIT_PRINT_OPERATION(context));
+ WebPageProxy* page = webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(printOperation->priv->webView));
+ page->endPrinting();
+ g_signal_emit(printOperation.get(), signals[FINISHED], 0, NULL);
+}
+
+static void webkitPrintOperationPrintPagesForFrame(WebKitPrintOperation* printOperation, WebFrameProxy* webFrame, GtkPrintSettings* printSettings, GtkPageSetup* pageSetup)
+{
+ PrintInfo printInfo(printSettings, pageSetup);
+ WebPageProxy* page = webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(printOperation->priv->webView));
+ page->drawPagesForPrinting(webFrame, printInfo, VoidCallback::create(g_object_ref(printOperation), &drawPagesForPrintingCompleted));
+}
+
+WebKitPrintOperationResponse webkitPrintOperationRunDialogForFrame(WebKitPrintOperation* printOperation, GtkWindow* parent, WebFrameProxy* webFrame)
+{
+ WebKitPrintOperationPrivate* priv = printOperation->priv;
+ if (!parent) {
+ GtkWidget* toplevel = gtk_widget_get_toplevel(GTK_WIDGET(priv->webView));
+ if (WebCore::widgetIsOnscreenToplevelWindow(toplevel))
+ parent = GTK_WINDOW(toplevel);
+ }
+
+ WebKitPrintOperationResponse response = webkitPrintOperationRunDialog(printOperation, parent);
+ if (response == WEBKIT_PRINT_OPERATION_RESPONSE_CANCEL)
+ return response;
+
+ webkitPrintOperationPrintPagesForFrame(printOperation, webFrame, priv->printSettings.get(), priv->pageSetup.get());
+ return response;
+}
+
+/**
+ * webkit_print_operation_new:
+ * @web_view: a #WebKitWebView
+ *
+ * Create a new #WebKitPrintOperation to print @web_view contents.
+ *
+ * Returns: (transfer full): a new #WebKitPrintOperation.
+ */
+WebKitPrintOperation* webkit_print_operation_new(WebKitWebView* webView)
+{
+ g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), 0);
+
+ return WEBKIT_PRINT_OPERATION(g_object_new(WEBKIT_TYPE_PRINT_OPERATION, "web-view", webView, NULL));
+}
+
+/**
+ * webkit_print_operation_get_print_settings:
+ * @print_operation: a #WebKitPrintOperation
+ *
+ * Return the current print settings of @print_operation. It returns %NULL until
+ * either webkit_print_operation_set_print_settings() or webkit_print_operation_run_dialog()
+ * have been called.
+ *
+ * Returns: (transfer none): the current #GtkPrintSettings of @print_operation.
+ */
+GtkPrintSettings* webkit_print_operation_get_print_settings(WebKitPrintOperation* printOperation)
+{
+ g_return_val_if_fail(WEBKIT_IS_PRINT_OPERATION(printOperation), 0);
+
+ return printOperation->priv->printSettings.get();
+}
+
+/**
+ * webkit_print_operation_set_print_settings:
+ * @print_operation: a #WebKitPrintOperation
+ * @print_settings: a #GtkPrintSettings to set
+ *
+ * Set the current print settings of @print_operation. Current print settings are used for
+ * the initial values of the print dialog when webkit_print_operation_run_dialog() is called.
+ */
+void webkit_print_operation_set_print_settings(WebKitPrintOperation* printOperation, GtkPrintSettings* printSettings)
+{
+ g_return_if_fail(WEBKIT_IS_PRINT_OPERATION(printOperation));
+ g_return_if_fail(GTK_IS_PRINT_SETTINGS(printSettings));
+
+ if (printOperation->priv->printSettings.get() == printSettings)
+ return;
+
+ printOperation->priv->printSettings = printSettings;
+ g_object_notify(G_OBJECT(printOperation), "print-settings");
+}
+
+/**
+ * webkit_print_operation_get_page_setup:
+ * @print_operation: a #WebKitPrintOperation
+ *
+ * Return the current page setup of @print_operation. It returns %NULL until
+ * either webkit_print_operation_set_print_settings() or webkit_print_operation_run_dialog()
+ * have been called.
+ *
+ * Returns: (transfer none): the current #GtkPageSetup of @print_operation.
+ */
+GtkPageSetup* webkit_print_operation_get_page_setup(WebKitPrintOperation* printOperation)
+{
+ g_return_val_if_fail(WEBKIT_IS_PRINT_OPERATION(printOperation), 0);
+
+ return printOperation->priv->pageSetup.get();
+}
+
+/**
+ * webkit_print_operation_set_page_setup:
+ * @print_operation: a #WebKitPrintOperation
+ * @page_setup: a #GtkPageSetup to set
+ *
+ * Set the current page setup of @print_operation. Current page setup is used for the
+ * initial values of the print dialog when webkit_print_operation_run_dialog() is called.
+ */
+void webkit_print_operation_set_page_setup(WebKitPrintOperation* printOperation, GtkPageSetup* pageSetup)
+{
+ g_return_if_fail(WEBKIT_IS_PRINT_OPERATION(printOperation));
+ g_return_if_fail(GTK_IS_PAGE_SETUP(pageSetup));
+
+ if (printOperation->priv->pageSetup.get() == pageSetup)
+ return;
+
+ printOperation->priv->pageSetup = pageSetup;
+ g_object_notify(G_OBJECT(printOperation), "page-setup");
+}
+
+/**
+ * webkit_print_operation_run_dialog:
+ * @print_operation: a #WebKitPrintOperation
+ * @parent: (allow-none): transient parent of the print dialog
+ *
+ * Run the print dialog and start printing using the options selected by
+ * the user. This method returns when the print dialog is closed.
+ * If the print dialog is cancelled %WEBKIT_PRINT_OPERATION_RESPONSE_CANCEL
+ * is returned. If the user clicks on the print button, %WEBKIT_PRINT_OPERATION_RESPONSE_PRINT
+ * is returned and the print operation starts. In this case, the WebKitPrintOperation::finished
+ * signal is emitted when the operation finishes.
+ * If the print dialog is not cancelled current print settings and page setup of @print_operation
+ * are updated with options selected by the user when Print button is pressed in print dialog.
+ * You can get the updated print settings and page setup by calling
+ * webkit_print_operation_get_print_settings() and webkit_print_operation_get_page_setup()
+ * after this method.
+ *
+ * Returns: the #WebKitPrintOperationResponse of the print dialog
+ */
+WebKitPrintOperationResponse webkit_print_operation_run_dialog(WebKitPrintOperation* printOperation, GtkWindow* parent)
+{
+ g_return_val_if_fail(WEBKIT_IS_PRINT_OPERATION(printOperation), WEBKIT_PRINT_OPERATION_RESPONSE_CANCEL);
+
+ WebPageProxy* page = webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(printOperation->priv->webView));
+ return webkitPrintOperationRunDialogForFrame(printOperation, parent, page->mainFrame());
+}
+
+/**
+ * webkit_print_operation_print:
+ * @print_operation: a #WebKitPrintOperation
+ *
+ * Start a print operation using current print settings and page setup
+ * without showing the print dialog. If either print settings or page setup
+ * are not set with webkit_print_operation_set_print_settings() and
+ * webkit_print_operation_set_page_setup(), the default options will be used
+ * and the print job will be sent to the default printer.
+ * The WebKitPrintOperation::finished signal is emitted when the printing
+ * operation finishes.
+ */
+void webkit_print_operation_print(WebKitPrintOperation* printOperation)
+{
+ g_return_if_fail(WEBKIT_IS_PRINT_OPERATION(printOperation));
+
+ WebKitPrintOperationPrivate* priv = printOperation->priv;
+ GRefPtr<GtkPrintSettings> printSettings = priv->printSettings ? priv->printSettings : adoptGRef(gtk_print_settings_new());
+ GRefPtr<GtkPageSetup> pageSetup = priv->pageSetup ? priv->pageSetup : adoptGRef(gtk_page_setup_new());
+
+ WebPageProxy* page = webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(printOperation->priv->webView));
+ webkitPrintOperationPrintPagesForFrame(printOperation, page->mainFrame(), printSettings.get(), pageSetup.get());
+}
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperation.h b/Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperation.h
new file mode 100644
index 000000000..a02f4e809
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperation.h
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2012 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#if !defined(__WEBKIT2_H_INSIDE__) && !defined(WEBKIT2_COMPILATION)
+#error "Only <webkit2/webkit2.h> can be included directly."
+#endif
+
+#ifndef WebKitPrintOperation_h
+#define WebKitPrintOperation_h
+
+#include <glib-object.h>
+#include <webkit2/WebKitDefines.h>
+#include <webkit2/WebKitWebView.h>
+
+G_BEGIN_DECLS
+
+#define WEBKIT_TYPE_PRINT_OPERATION (webkit_print_operation_get_type())
+#define WEBKIT_PRINT_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_PRINT_OPERATION, WebKitPrintOperation))
+#define WEBKIT_IS_PRINT_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_PRINT_OPERATION))
+#define WEBKIT_PRINT_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_PRINT_OPERATION, WebKitPrintOperationClass))
+#define WEBKIT_IS_PRINT_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_PRINT_OPERATION))
+#define WEBKIT_PRINT_OPERATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_PRINT_OPERATION, WebKitPrintOperationClass))
+
+typedef struct _WebKitPrintOperationClass WebKitPrintOperationClass;
+typedef struct _WebKitPrintOperationPrivate WebKitPrintOperationPrivate;
+
+/**
+ * WebKitPrintOperationResponse:
+ * @WEBKIT_PRINT_OPERATION_RESPONSE_PRINT: Print button was cliked in print dialog
+ * @WEBKIT_PRINT_OPERATION_RESPONSE_CANCEL: Print dialog was cancelled
+ *
+ * Enum values representing the response of the print dialog shown with
+ * webkit_print_operation_run_dialog().
+ */
+typedef enum {
+ WEBKIT_PRINT_OPERATION_RESPONSE_PRINT,
+ WEBKIT_PRINT_OPERATION_RESPONSE_CANCEL
+} WebKitPrintOperationResponse;
+
+struct _WebKitPrintOperation {
+ GObject parent;
+
+ WebKitPrintOperationPrivate *priv;
+};
+
+struct _WebKitPrintOperationClass {
+ GObjectClass parent_class;
+};
+
+WEBKIT_API GType
+webkit_print_operation_get_type (void);
+
+WEBKIT_API WebKitPrintOperation *
+webkit_print_operation_new (WebKitWebView *web_view);
+
+WEBKIT_API GtkPrintSettings *
+webkit_print_operation_get_print_settings (WebKitPrintOperation *print_operation);
+
+WEBKIT_API void
+webkit_print_operation_set_print_settings (WebKitPrintOperation *print_operation,
+ GtkPrintSettings *print_settings);
+
+WEBKIT_API GtkPageSetup *
+webkit_print_operation_get_page_setup (WebKitPrintOperation *print_operation);
+
+WEBKIT_API void
+webkit_print_operation_set_page_setup (WebKitPrintOperation *print_operation,
+ GtkPageSetup *page_setup);
+
+WEBKIT_API WebKitPrintOperationResponse
+webkit_print_operation_run_dialog (WebKitPrintOperation *print_operation,
+ GtkWindow *parent);
+
+WEBKIT_API void
+webkit_print_operation_print (WebKitPrintOperation *print_operation);
+
+G_END_DECLS
+
+#endif
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperationPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperationPrivate.h
new file mode 100644
index 000000000..7a4fb4e43
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperationPrivate.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2012 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef WebKitPrintOperationPrivate_h
+#define WebKitPrintOperationPrivate_h
+
+#include "WebFrameProxy.h"
+#include "WebKitPrintOperation.h"
+
+WebKitPrintOperationResponse webkitPrintOperationRunDialogForFrame(WebKitPrintOperation*, GtkWindow* parent, WebKit::WebFrameProxy*);
+
+#endif // WebKitPrintOperationPrivate_h
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.cpp
new file mode 100644
index 000000000..998c3abfa
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.cpp
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2012 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "WebKitPrivate.h"
+
+#include <gdk/gdk.h>
+
+unsigned wkEventModifiersToGdkModifiers(WKEventModifiers wkModifiers)
+{
+ unsigned modifiers = 0;
+ if (wkModifiers & kWKEventModifiersShiftKey)
+ modifiers |= GDK_SHIFT_MASK;
+ if (wkModifiers & kWKEventModifiersControlKey)
+ modifiers |= GDK_CONTROL_MASK;
+ if (wkModifiers & kWKEventModifiersAltKey)
+ modifiers |= GDK_MOD1_MASK;
+ if (wkModifiers & kWKEventModifiersMetaKey)
+ modifiers |= GDK_META_MASK;
+ return modifiers;
+}
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h
index c44d877e0..43d26cc85 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h
@@ -40,4 +40,6 @@
#define COMPILE_ASSERT_MATCHING_ENUM(webkitName, webcoreName) \
COMPILE_ASSERT(int(webkitName) == int(webcoreName), mismatchingEnums)
+unsigned wkEventModifiersToGdkModifiers(WKEventModifiers);
+
#endif // WebKitPrivate_h
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp
index 774f17190..c1c4a970b 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp
@@ -102,7 +102,8 @@ enum {
PROP_ENABLE_CARET_BROWSING,
PROP_ENABLE_FULLSCREEN,
PROP_PRINT_BACKGROUNDS,
- PROP_ENABLE_WEBAUDIO
+ PROP_ENABLE_WEBAUDIO,
+ PROP_ENABLE_WEBGL
};
static void webKitSettingsSetProperty(GObject* object, guint propId, const GValue* value, GParamSpec* paramSpec)
@@ -206,6 +207,9 @@ static void webKitSettingsSetProperty(GObject* object, guint propId, const GValu
case PROP_ENABLE_WEBAUDIO:
webkit_settings_set_enable_webaudio(settings, g_value_get_boolean(value));
break;
+ case PROP_ENABLE_WEBGL:
+ webkit_settings_set_enable_webgl(settings, g_value_get_boolean(value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, paramSpec);
break;
@@ -313,6 +317,9 @@ static void webKitSettingsGetProperty(GObject* object, guint propId, GValue* val
case PROP_ENABLE_WEBAUDIO:
g_value_set_boolean(value, webkit_settings_get_enable_webaudio(settings));
break;
+ case PROP_ENABLE_WEBGL:
+ g_value_set_boolean(value, webkit_settings_get_enable_webgl(settings));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, paramSpec);
break;
@@ -794,6 +801,21 @@ static void webkit_settings_class_init(WebKitSettingsClass* klass)
FALSE,
readWriteConstructParamFlags));
+ /**
+ * WebKitSettings:enable-webgl:
+ *
+ * Enable or disable support for WebGL on pages. WebGL is an experimental
+ * proposal for allowing web pages to use OpenGL ES-like calls directly. The
+ * standard is currently a work-in-progress by the Khronos Group.
+ */
+ g_object_class_install_property(gObjectClass,
+ PROP_ENABLE_WEBGL,
+ g_param_spec_boolean("enable-webgl",
+ _("Enable WebGL"),
+ _("Whether WebGL content should be rendered"),
+ FALSE,
+ readWriteConstructParamFlags));
+
g_type_class_add_private(klass, sizeof(WebKitSettingsPrivate));
}
@@ -2016,3 +2038,38 @@ void webkit_settings_set_enable_webaudio(WebKitSettings* settings, gboolean enab
WKPreferencesSetWebAudioEnabled(priv->preferences.get(), enabled);
g_object_notify(G_OBJECT(settings), "enable-webaudio");
}
+
+/**
+ * webkit_settings_get_enable_webgl:
+ * @settings: a #WebKitSettings
+ *
+ * Get the #WebKitSettings:enable-webgl property.
+ *
+ * Returns: %TRUE If webgl support is enabled or %FALSE otherwise.
+ */
+gboolean webkit_settings_get_enable_webgl(WebKitSettings* settings)
+{
+ g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
+
+ return WKPreferencesGetWebGLEnabled(settings->priv->preferences.get());
+}
+
+/**
+ * webkit_settings_set_enable_webgl:
+ * @settings: a #WebKitSettings
+ * @enabled: Value to be set
+ *
+ * Set the #WebKitSettings:enable-webgl property.
+ */
+void webkit_settings_set_enable_webgl(WebKitSettings* settings, gboolean enabled)
+{
+ g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
+
+ WebKitSettingsPrivate* priv = settings->priv;
+ bool currentValue = WKPreferencesGetWebGLEnabled(priv->preferences.get());
+ if (currentValue == enabled)
+ return;
+
+ WKPreferencesSetWebGLEnabled(priv->preferences.get(), enabled);
+ g_object_notify(G_OBJECT(settings), "enable-webgl");
+}
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.h b/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.h
index 27cb7c75a..b22ba00ff 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.h
@@ -300,6 +300,13 @@ WEBKIT_API void
webkit_settings_set_enable_webaudio (WebKitSettings *settings,
gboolean enabled);
+WEBKIT_API gboolean
+webkit_settings_get_enable_webgl (WebKitSettings *settings);
+
+WEBKIT_API void
+webkit_settings_set_enable_webgl (WebKitSettings *settings,
+ gboolean enabled);
+
G_END_DECLS
#endif /* WebKitSettings_h */
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp
index a659ad314..6f0e11c82 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp
@@ -126,6 +126,16 @@ static void setWindowFrame(WKPageRef page, WKRect frame, const void* clientInfo)
webkitWindowPropertiesSetGeometry(windowProperties, &geometry);
}
+static void mouseDidMoveOverElement(WKPageRef page, WKHitTestResultRef hitTestResult, WKEventModifiers modifiers, WKTypeRef userData, const void* clientInfo)
+{
+ webkitWebViewMouseTargetChanged(WEBKIT_WEB_VIEW(clientInfo), hitTestResult, wkEventModifiersToGdkModifiers(modifiers));
+}
+
+static void printFrame(WKPageRef page, WKFrameRef frame, const void*)
+{
+ webkitWebViewPrintFrame(WEBKIT_WEB_VIEW(toImpl(page)->viewWidget()), frame);
+}
+
void attachUIClientToView(WebKitWebView* webView)
{
WKPageUIClient wkUIClient = {
@@ -165,13 +175,13 @@ void attachUIClientToView(WebKitWebView* webView)
0, // footerHeight
0, // drawHeader
0, // drawFooter
- 0, // printFrame
+ printFrame,
0, // runModal
0, // didCompleteRubberBandForMainFrame
0, // saveDataToFileInDownloadsFolder
0, // shouldInterruptJavaScript
createNewPage,
- 0, // mouseDidMoveOverElement
+ mouseDidMoveOverElement,
0, // decidePolicyForNotificationPermissionRequest
};
WKPageRef wkPage = toAPI(webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView)));
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
index c3accccbb..be590ff33 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
@@ -24,9 +24,11 @@
#include "WebKitBackForwardListPrivate.h"
#include "WebKitEnumTypes.h"
#include "WebKitError.h"
+#include "WebKitHitTestResultPrivate.h"
#include "WebKitLoaderClient.h"
#include "WebKitMarshal.h"
#include "WebKitPolicyClient.h"
+#include "WebKitPrintOperationPrivate.h"
#include "WebKitPrivate.h"
#include "WebKitSettingsPrivate.h"
#include "WebKitUIClient.h"
@@ -59,6 +61,10 @@ enum {
DECIDE_POLICY,
+ MOUSE_TARGET_CHANGED,
+
+ PRINT_REQUESTED,
+
LAST_SIGNAL
};
@@ -83,6 +89,9 @@ struct _WebKitWebViewPrivate {
GRefPtr<WebKitBackForwardList> backForwardList;
GRefPtr<WebKitSettings> settings;
GRefPtr<WebKitWindowProperties> windowProperties;
+
+ GRefPtr<WebKitHitTestResult> mouseTargetHitTestResult;
+ unsigned mouseTargetModifiers;
};
static guint signals[LAST_SIGNAL] = { 0, };
@@ -615,6 +624,59 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
G_TYPE_BOOLEAN, 2, /* number of parameters */
WEBKIT_TYPE_POLICY_DECISION,
WEBKIT_TYPE_POLICY_DECISION_TYPE);
+
+ /**
+ * WebKitWebView::mouse-target-changed:
+ * @web_view: the #WebKitWebView on which the signal is emitted
+ * @hit_test_result: a #WebKitHitTestResult
+ * @modifiers: a bitmask of #GdkModifierType
+ *
+ * This signal is emitted when the mouse cursor moves over an
+ * element such as a link, image or a media element. To determine
+ * what type of element the mouse cursor is over, a Hit Test is performed
+ * on the current mouse coordinates and the result is passed in the
+ * @hit_test_result argument. The @modifiers argument is a bitmask of
+ * #GdkModifierType flags indicating the state of modifier keys.
+ * The signal is emitted again when the mouse is moved out of the
+ * current element with a new @hit_test_result.
+ */
+ signals[MOUSE_TARGET_CHANGED] =
+ g_signal_new("mouse-target-changed",
+ G_TYPE_FROM_CLASS(webViewClass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(WebKitWebViewClass, mouse_target_changed),
+ 0, 0,
+ webkit_marshal_VOID__OBJECT_UINT,
+ G_TYPE_NONE, 2,
+ WEBKIT_TYPE_HIT_TEST_RESULT,
+ G_TYPE_UINT);
+ /**
+ * WebKitWebView::print-requested:
+ * @web_view: the #WebKitWebView on which the signal is emitted
+ * @print_operation: the #WebKitPrintOperation that will handle the print request
+ *
+ * Emitted when printing is requested on @web_view, usually by a javascript call,
+ * before the print dialog is shown. This signal can be used to set the initial
+ * print settings and page setup of @print_operation to be used as default values in
+ * the print dialog. You can call webkit_print_operation_set_print_settings() and
+ * webkit_print_operation_set_page_setup() and then return %FALSE to propagate the
+ * event so that the print dialog is shown.
+ *
+ * You can connect to this signal and return %TRUE to cancel the print operation
+ * or implement your own print dialog.
+ *
+ * Returns: %TRUE to stop other handlers from being invoked for the event.
+ * %FALSE to propagate the event further.
+ */
+ signals[PRINT_REQUESTED] =
+ g_signal_new("print-requested",
+ G_TYPE_FROM_CLASS(webViewClass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(WebKitWebViewClass, print_requested),
+ g_signal_accumulator_true_handled, 0,
+ webkit_marshal_BOOLEAN__OBJECT,
+ G_TYPE_BOOLEAN, 1,
+ WEBKIT_TYPE_PRINT_OPERATION);
}
void webkitWebViewLoadChanged(WebKitWebView* webView, WebKitLoadEvent loadEvent)
@@ -726,6 +788,33 @@ void webkitWebViewMakePolicyDecision(WebKitWebView* webView, WebKitPolicyDecisio
g_signal_emit(webView, signals[DECIDE_POLICY], 0, decision, type, &returnValue);
}
+void webkitWebViewMouseTargetChanged(WebKitWebView* webView, WKHitTestResultRef wkHitTestResult, unsigned modifiers)
+{
+ WebKitWebViewPrivate* priv = webView->priv;
+ if (priv->mouseTargetHitTestResult
+ && priv->mouseTargetModifiers == modifiers
+ && webkitHitTestResultCompare(priv->mouseTargetHitTestResult.get(), wkHitTestResult))
+ return;
+
+ priv->mouseTargetModifiers = modifiers;
+ priv->mouseTargetHitTestResult = adoptGRef(webkitHitTestResultCreate(wkHitTestResult));
+ g_signal_emit(webView, signals[MOUSE_TARGET_CHANGED], 0, priv->mouseTargetHitTestResult.get(), modifiers);
+}
+
+void webkitWebViewPrintFrame(WebKitWebView* webView, WKFrameRef wkFrame)
+{
+ GRefPtr<WebKitPrintOperation> printOperation = adoptGRef(webkit_print_operation_new(webView));
+ gboolean returnValue;
+ g_signal_emit(webView, signals[PRINT_REQUESTED], 0, printOperation.get(), &returnValue);
+ if (returnValue)
+ return;
+
+ WebKitPrintOperationResponse response = webkitPrintOperationRunDialogForFrame(printOperation.get(), 0, toImpl(wkFrame));
+ if (response == WEBKIT_PRINT_OPERATION_RESPONSE_CANCEL)
+ return;
+ g_signal_connect(printOperation.leakRef(), "finished", G_CALLBACK(g_object_unref), 0);
+}
+
/**
* webkit_web_view_new:
*
@@ -796,10 +885,14 @@ void webkit_web_view_load_uri(WebKitWebView* webView, const gchar* uri)
* @base_uri: (allow-none): The base URI for relative locations or %NULL
*
* Load the given @content string with the specified @base_uri.
- * Relative URLs in the @content will be resolved against @base_uri.
- * When @base_uri is %NULL, it defaults to "about:blank". The mime type
- * of the document will be "text/html". You can monitor the load operation
- * by connecting to #WebKitWebView::load-changed signal.
+ * If @base_uri is not %NULL, relative URLs in the @content will be
+ * resolved against @base_uri and absolute local paths must be children of the @base_uri.
+ * For security reasons absolute local paths that are not children of @base_uri
+ * will cause the web process to terminate.
+ * If you need to include URLs in @content that are local paths in a different
+ * directory than @base_uri you can build a data URI for them. When @base_uri is %NULL,
+ * it defaults to "about:blank". The mime type of the document will be "text/html".
+ * You can monitor the load operation by connecting to #WebKitWebView::load-changed signal.
*/
void webkit_web_view_load_html(WebKitWebView* webView, const gchar* content, const gchar* baseURI)
{
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h b/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h
index d4768e3b6..a1b21420b 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h
@@ -30,9 +30,10 @@
#include <webkit2/WebKitBackForwardList.h>
#include <webkit2/WebKitDefines.h>
-#include <webkit2/WebKitWebContext.h>
+#include <webkit2/WebKitHitTestResult.h>
#include <webkit2/WebKitSettings.h>
#include <webkit2/WebKitURIRequest.h>
+#include <webkit2/WebKitWebContext.h>
#include <webkit2/WebKitWebViewBase.h>
#include <webkit2/WebKitWindowProperties.h>
#include <webkit2/WebKitPolicyDecision.h>
@@ -116,29 +117,34 @@ struct _WebKitWebView {
struct _WebKitWebViewClass {
WebKitWebViewBaseClass parent;
- void (* load_changed) (WebKitWebView *web_view,
- WebKitLoadEvent load_event);
- gboolean (* load_failed) (WebKitWebView *web_view,
- WebKitLoadEvent load_event,
- const gchar *failing_uri,
- GError *error);
-
- GtkWidget *(* create) (WebKitWebView *web_view);
- void (* ready_to_show) (WebKitWebView *web_view);
- void (* close) (WebKitWebView *web_view);
-
- gboolean (* script_alert) (WebKitWebView *web_view,
- const gchar *message);
- gboolean (* script_confirm) (WebKitWebView *web_view,
- const gchar *message,
- gboolean *confirmed);
- gboolean (* script_prompt) (WebKitWebView *web_view,
- const gchar *message,
- const gchar *default_text,
- gchar **text);
- gboolean (* decide_policy) (WebKitWebView *web_view,
- WebKitPolicyDecision *decision,
- WebKitPolicyDecisionType type);
+ void (* load_changed) (WebKitWebView *web_view,
+ WebKitLoadEvent load_event);
+ gboolean (* load_failed) (WebKitWebView *web_view,
+ WebKitLoadEvent load_event,
+ const gchar *failing_uri,
+ GError *error);
+
+ GtkWidget *(* create) (WebKitWebView *web_view);
+ void (* ready_to_show) (WebKitWebView *web_view);
+ void (* close) (WebKitWebView *web_view);
+
+ gboolean (* script_alert) (WebKitWebView *web_view,
+ const gchar *message);
+ gboolean (* script_confirm) (WebKitWebView *web_view,
+ const gchar *message,
+ gboolean *confirmed);
+ gboolean (* script_prompt) (WebKitWebView *web_view,
+ const gchar *message,
+ const gchar *default_text,
+ gchar **text);
+ gboolean (* decide_policy) (WebKitWebView *web_view,
+ WebKitPolicyDecision *decision,
+ WebKitPolicyDecisionType type);
+ void (* mouse_target_changed) (WebKitWebView *web_view,
+ WebKitHitTestResult *hit_test_result,
+ guint modifiers);
+ gboolean (* print_requested) (WebKitWebView *web_view,
+ WebKitPrintOperation *print_operation);
/* Padding for future expansion */
void (*_webkit_reserved0) (void);
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h
index 66386d028..ad8ab2038 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h
@@ -43,5 +43,7 @@ void webkitWebViewRunJavaScriptAlert(WebKitWebView*, const CString& message);
bool webkitWebViewRunJavaScriptConfirm(WebKitWebView*, const CString& message);
WKStringRef webkitWebViewRunJavaScriptPrompt(WebKitWebView*, const CString& message, const CString& defaultText);
void webkitWebViewMakePolicyDecision(WebKitWebView*, WebKitPolicyDecisionType, WebKitPolicyDecision*);
+void webkitWebViewMouseTargetChanged(WebKitWebView*, WKHitTestResultRef, unsigned modifiers);
+void webkitWebViewPrintFrame(WebKitWebView*, WKFrameRef);
#endif // WebKitWebViewPrivate_h
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp
index 413890203..242b753e8 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp
@@ -377,7 +377,7 @@ void webkitWindowPropertiesSetResizable(WebKitWindowProperties* windowProperties
if (windowProperties->priv->resizable == resizable)
return;
windowProperties->priv->resizable = resizable;
- g_object_notify(G_OBJECT(windowProperties), "resizable-visible");
+ g_object_notify(G_OBJECT(windowProperties), "resizable");
}
void webkitWindowPropertiesSetFullscreen(WebKitWindowProperties* windowProperties, bool fullscreen)
diff --git a/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml b/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml
index af0cdae7c..5cd859dad 100644
--- a/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml
+++ b/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml
@@ -24,6 +24,8 @@
<xi:include href="xml/WebKitPolicyDecision.xml"/>
<xi:include href="xml/WebKitNavigationPolicyDecision.xml"/>
<xi:include href="xml/WebKitResponsePolicyDecision.xml"/>
+ <xi:include href="xml/WebKitHitTestResult.xml"/>
+ <xi:include href="xml/WebKitPrintOperation.xml"/>
<xi:include href="xml/WebKitError.xml"/>
</chapter>
diff --git a/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt b/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt
index 52cd89ee7..5bfc129b2 100644
--- a/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt
+++ b/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt
@@ -218,6 +218,8 @@ webkit_settings_get_print_backgrounds
webkit_settings_set_print_backgrounds
webkit_settings_get_enable_webaudio
webkit_settings_set_enable_webaudio
+webkit_settings_get_enable_webgl
+webkit_settings_set_enable_webgl
<SUBSECTION Standard>
WebKitSettingsClass
@@ -390,6 +392,60 @@ webkit_response_policy_decision_get_type
</SECTION>
<SECTION>
+<FILE>WebKitHitTestResult</FILE>
+WebKitHitTestResult
+WebKitHitTestResultContext
+webkit_hit_test_result_get_context
+webkit_hit_test_result_context_is_link
+webkit_hit_test_result_context_is_image
+webkit_hit_test_result_context_is_media
+webkit_hit_test_result_get_link_uri
+webkit_hit_test_result_get_link_title
+webkit_hit_test_result_get_link_label
+webkit_hit_test_result_get_image_uri
+webkit_hit_test_result_get_media_uri
+
+<SUBSECTION Standard>
+WebKitHitTestResultClass
+WEBKIT_TYPE_HIT_TEST_RESULT
+WEBKIT_HIT_TEST_RESULT
+WEBKIT_IS_HIT_TEST_RESULT
+WEBKIT_HIT_TEST_RESULT_CLASS
+WEBKIT_IS_HIT_TEST_RESULT_CLASS
+WEBKIT_HIT_TEST_RESULT_GET_CLASS
+
+<SUBSECTION Private>
+WebKitHitTestResultPrivate
+webkit_hit_test_result_get_type
+</SECTION>
+
+<SECTION>
+<FILE>WebKitPrintOperation</FILE>
+WebKitPrintOperation
+WebKitPrintOperationResponse
+webkit_print_operation_new
+webkit_print_operation_get_print_settings
+webkit_print_operation_set_print_settings
+webkit_print_operation_get_page_setup
+webkit_print_operation_set_page_setup
+webkit_print_operation_run_dialog
+webkit_print_operation_print
+
+<SUBSECTION Standard>
+WebKitPrintOperationClass
+WEBKIT_TYPE_PRINT_OPERATION
+WEBKIT_PRINT_OPERATION
+WEBKIT_IS_PRINT_OPERATION
+WEBKIT_PRINT_OPERATION_CLASS
+WEBKIT_IS_PRINT_OPERATION_CLASS
+WEBKIT_PRINT_OPERATION_GET_CLASS
+
+<SUBSECTION Private>
+WebKitPrintOperationPrivate
+webkit_print_operation_get_type
+</SECTION>
+
+<SECTION>
<FILE>WebKitError</FILE>
WEBKIT_NETWORK_ERROR
WEBKIT_PLUGIN_ERROR
diff --git a/Source/WebKit2/UIProcess/API/gtk/tests/GNUmakefile.am b/Source/WebKit2/UIProcess/API/gtk/tests/GNUmakefile.am
index 7241b9980..35ece6845 100644
--- a/Source/WebKit2/UIProcess/API/gtk/tests/GNUmakefile.am
+++ b/Source/WebKit2/UIProcess/API/gtk/tests/GNUmakefile.am
@@ -1,3 +1,5 @@
+if ENABLE_WEBKIT2
+
TEST_PROGS += \
Programs/WebKit2APITests/TestWebKitWebContext \
Programs/WebKit2APITests/TestWebKitWebView \
@@ -6,7 +8,8 @@ TEST_PROGS += \
Programs/WebKit2APITests/TestBackForwardList \
Programs/WebKit2APITests/TestDownloads \
Programs/WebKit2APITests/TestWebKitPolicyClient \
- Programs/WebKit2APITests/TestWebViewEditor
+ Programs/WebKit2APITests/TestWebViewEditor \
+ Programs/WebKit2APITests/TestPrinting
noinst_PROGRAMS += $(TEST_PROGS)
@@ -118,3 +121,11 @@ Programs_WebKit2APITests_TestWebViewEditor_SOURCES = \
Programs_WebKit2APITests_TestWebViewEditor_CPPFLAGS = $(webkit2_tests_cppflags)
Programs_WebKit2APITests_TestWebViewEditor_LDADD = $(webkit2_tests_ldadd)
Programs_WebKit2APITests_TestWebViewEditor_LDFLAGS = $(webkit2_tests_ldflags)
+
+Programs_WebKit2APITests_TestPrinting_SOURCES = \
+ Source/WebKit2/UIProcess/API/gtk/tests/TestPrinting.cpp
+Programs_WebKit2APITests_TestPrinting_CPPFLAGS = $(webkit2_tests_cppflags) $(GTK_UNIX_PRINTING_CFLAGS)
+Programs_WebKit2APITests_TestPrinting_LDADD = $(webkit2_tests_ldadd) $(GTK_UNIX_PRINTING_LIBS)
+Programs_WebKit2APITests_TestPrinting_LDFLAGS = $(webkit2_tests_ldflags)
+
+endif # ENABLE_WEBKIT2
diff --git a/Source/WebKit2/UIProcess/API/gtk/tests/TestPrinting.cpp b/Source/WebKit2/UIProcess/API/gtk/tests/TestPrinting.cpp
new file mode 100644
index 000000000..1ddde0858
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/gtk/tests/TestPrinting.cpp
@@ -0,0 +1,152 @@
+/*
+ * Copyright (C) 2012 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2,1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "WebViewTest.h"
+#include <glib/gstdio.h>
+#include <wtf/gobject/GRefPtr.h>
+
+#ifdef HAVE_GTK_UNIX_PRINTING
+#include <gtk/gtkunixprint.h>
+#endif
+
+static char* kTempDirectory;
+
+static void testPrintOperationPrintSettings(WebViewTest* test, gconstpointer)
+{
+ GRefPtr<WebKitPrintOperation> printOperation = adoptGRef(webkit_print_operation_new(test->m_webView));
+ test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(printOperation.get()));
+
+ g_assert(!webkit_print_operation_get_print_settings(printOperation.get()));
+ g_assert(!webkit_print_operation_get_page_setup(printOperation.get()));
+
+ GRefPtr<GtkPrintSettings> printSettings = adoptGRef(gtk_print_settings_new());
+ test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(printSettings.get()));
+
+ GRefPtr<GtkPageSetup> pageSetup = adoptGRef(gtk_page_setup_new());
+ test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(pageSetup.get()));
+
+ webkit_print_operation_set_print_settings(printOperation.get(), printSettings.get());
+ webkit_print_operation_set_page_setup(printOperation.get(), pageSetup.get());
+
+ g_assert(webkit_print_operation_get_print_settings(printOperation.get()) == printSettings.get());
+ g_assert(webkit_print_operation_get_page_setup(printOperation.get()) == pageSetup.get());
+}
+
+static gboolean webViewPrintRequestedCallback(WebKitWebView* webView, WebKitPrintOperation* printOperation, WebViewTest* test)
+{
+ g_assert(webView == test->m_webView);
+
+ g_assert(WEBKIT_IS_PRINT_OPERATION(printOperation));
+ test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(printOperation));
+
+ g_assert(!webkit_print_operation_get_print_settings(printOperation));
+ g_assert(!webkit_print_operation_get_page_setup(printOperation));
+
+ g_main_loop_quit(test->m_mainLoop);
+
+ return TRUE;
+}
+
+static void testWebViewPrintRequested(WebViewTest* test, gconstpointer)
+{
+ g_signal_connect(test->m_webView, "print-requested", G_CALLBACK(webViewPrintRequestedCallback), test);
+ test->loadHtml("<html><body onLoad=\"print();\">WebKitGTK+ printing test</body></html>", 0);
+ g_main_loop_run(test->m_mainLoop);
+}
+
+#ifdef HAVE_GTK_UNIX_PRINTING
+static void testPrintOperationPrintLoadChanged(WebKitWebView*, WebKitLoadEvent loadEvent, WebViewTest* test)
+{
+ if (loadEvent != WEBKIT_LOAD_FINISHED)
+ return;
+ g_main_loop_quit(test->m_mainLoop);
+}
+
+static void testPrintOperationPrintFinished(WebKitPrintOperation* printOperation, WebViewTest* test)
+{
+ g_object_unref(printOperation);
+ g_main_loop_quit(test->m_mainLoop);
+}
+
+static gboolean testPrintOperationPrintPrinter(GtkPrinter* printer, gpointer userData)
+{
+ if (strcmp(gtk_printer_get_name(printer), "Print to File"))
+ return FALSE;
+
+ GtkPrinter** foundPrinter = static_cast<GtkPrinter**>(userData);
+ *foundPrinter = static_cast<GtkPrinter*>(g_object_ref(printer));
+ return TRUE;
+}
+
+static void testPrintOperationPrint(WebViewTest* test, gconstpointer)
+{
+ g_signal_connect(test->m_webView, "load-changed", G_CALLBACK(testPrintOperationPrintLoadChanged), test);
+ test->loadHtml("<html><body>WebKitGTK+ printing test</body></html>", 0);
+ g_main_loop_run(test->m_mainLoop);
+
+ GtkPrinter* printer = 0;
+ gtk_enumerate_printers(testPrintOperationPrintPrinter, &printer, 0, TRUE);
+ if (!printer) {
+ g_message("%s", "Cannot test WebKitPrintOperation/print: no suitable printer found");
+ return;
+ }
+
+ GOwnPtr<char> outputFilename(g_build_filename(kTempDirectory, "webkit-print.pdf", NULL));
+ GRefPtr<GFile> outputFile = adoptGRef(g_file_new_for_path(outputFilename.get()));
+ GOwnPtr<char> outputURI(g_file_get_uri(outputFile.get()));
+
+ GRefPtr<GtkPrintSettings> printSettings = adoptGRef(gtk_print_settings_new());
+ gtk_print_settings_set_printer(printSettings.get(), gtk_printer_get_name(printer));
+ gtk_print_settings_set(printSettings.get(), GTK_PRINT_SETTINGS_OUTPUT_URI, outputURI.get());
+ g_object_unref(printer);
+
+ GRefPtr<WebKitPrintOperation> printOperation = webkit_print_operation_new(test->m_webView);
+ test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(printOperation.get()));
+ g_signal_connect(printOperation.get(), "finished", G_CALLBACK(testPrintOperationPrintFinished), test);
+ webkit_print_operation_set_print_settings(printOperation.get(), printSettings.get());
+ webkit_print_operation_print(printOperation.get());
+ g_main_loop_run(test->m_mainLoop);
+
+ GRefPtr<GFileInfo> fileInfo = adoptGRef(g_file_query_info(outputFile.get(), G_FILE_ATTRIBUTE_STANDARD_SIZE","G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+ static_cast<GFileQueryInfoFlags>(0), 0, 0));
+ g_assert(fileInfo.get());
+ g_assert_cmpint(g_file_info_get_size(fileInfo.get()), >, 0);
+ g_assert_cmpstr(g_file_info_get_content_type(fileInfo.get()), ==, "application/pdf");
+
+ g_file_delete(outputFile.get(), 0, 0);
+}
+#endif // HAVE_GTK_UNIX_PRINTING
+
+void beforeAll()
+{
+ kTempDirectory = g_dir_make_tmp("WebKit2Tests-XXXXXX", 0);
+ g_assert(kTempDirectory);
+
+ WebViewTest::add("WebKitPrintOperation", "printing-settings", testPrintOperationPrintSettings);
+ WebViewTest::add("WebKitWebView", "print-requested", testWebViewPrintRequested);
+#ifdef HAVE_GTK_UNIX_PRINTING
+ WebViewTest::add("WebKitPrintOperation", "print", testPrintOperationPrint);
+#endif
+}
+
+void afterAll()
+{
+ g_rmdir(kTempDirectory);
+}
diff --git a/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitSettings.cpp b/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitSettings.cpp
index 0ecea5604..a3ce7dece 100644
--- a/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitSettings.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitSettings.cpp
@@ -194,6 +194,11 @@ static void testWebKitSettings(Test*, gconstpointer)
webkit_settings_set_enable_webaudio(settings, TRUE);
g_assert(webkit_settings_get_enable_webaudio(settings));
+ // WebGL is disabled by default.
+ g_assert(!webkit_settings_get_enable_webgl(settings));
+ webkit_settings_set_enable_webgl(settings, TRUE);
+ g_assert(webkit_settings_get_enable_webgl(settings));
+
g_object_unref(G_OBJECT(settings));
}
diff --git a/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebView.cpp b/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebView.cpp
index 3d59ee917..47da98eb3 100644
--- a/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebView.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebView.cpp
@@ -267,15 +267,27 @@ public:
return TRUE;
}
+ static void mouseTargetChanged(WebKitWebView*, WebKitHitTestResult* hitTestResult, guint modifiers, UIClientTest* test)
+ {
+ g_assert(WEBKIT_IS_HIT_TEST_RESULT(hitTestResult));
+ test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(hitTestResult));
+
+ test->m_mouseTargetHitTestResult = hitTestResult;
+ test->m_mouseTargetModifiers = modifiers;
+ g_main_loop_quit(test->m_mainLoop);
+ }
+
UIClientTest()
: m_scriptType(Alert)
, m_scriptDialogConfirmed(true)
+ , m_mouseTargetModifiers(0)
{
webkit_settings_set_javascript_can_open_windows_automatically(webkit_web_view_get_settings(m_webView), TRUE);
g_signal_connect(m_webView, "create", G_CALLBACK(viewCreate), this);
g_signal_connect(m_webView, "script-alert", G_CALLBACK(scriptAlert), this);
g_signal_connect(m_webView, "script-confirm", G_CALLBACK(scriptConfirm), this);
g_signal_connect(m_webView, "script-prompt", G_CALLBACK(scriptPrompt), this);
+ g_signal_connect(m_webView, "mouse-target-changed", G_CALLBACK(mouseTargetChanged), this);
}
~UIClientTest()
@@ -293,11 +305,20 @@ public:
m_windowProperties = windowProperties;
}
+ WebKitHitTestResult* moveMouseAndWaitUntilMouseTargetChanged(int x, int y, unsigned int mouseModifiers = 0)
+ {
+ mouseMoveTo(x, y, mouseModifiers);
+ g_main_loop_run(m_mainLoop);
+ return m_mouseTargetHitTestResult.get();
+ }
+
Vector<WebViewEvents> m_webViewEvents;
ScriptType m_scriptType;
bool m_scriptDialogConfirmed;
WindowProperties m_windowProperties;
HashSet<WTF::String> m_windowPropertiesChanged;
+ GRefPtr<WebKitHitTestResult> m_mouseTargetHitTestResult;
+ unsigned int m_mouseTargetModifiers;
};
static void testWebViewCreateReadyClose(UIClientTest* test, gconstpointer)
@@ -361,6 +382,66 @@ static void testWebViewWindowProperties(UIClientTest* test, gconstpointer)
g_assert_cmpint(events[2], ==, UIClientTest::Close);
}
+static void testWebViewMouseTarget(UIClientTest* test, gconstpointer)
+{
+ test->showInWindowAndWaitUntilMapped();
+
+ const char* linksHoveredHTML =
+ "<html><body>"
+ " <a style='position:absolute; left:1; top:1' href='http://www.webkitgtk.org' title='WebKitGTK+ Title'>WebKitGTK+ Website</a>"
+ " <img style='position:absolute; left:1; top:10' src='0xdeadbeef' width=5 height=5></img>"
+ " <a style='position:absolute; left:1; top:20' href='http://www.webkitgtk.org/logo' title='WebKitGTK+ Logo'><img src='0xdeadbeef' width=5 height=5></img></a>"
+ " <video style='position:absolute; left:1; top:30' width=10 height=10 controls='controls'><source src='movie.ogg' type='video/ogg' /></video>"
+ "</body></html>";
+
+ test->loadHtml(linksHoveredHTML, "file:///");
+ test->waitUntilLoadFinished();
+
+ // Move over link.
+ WebKitHitTestResult* hitTestResult = test->moveMouseAndWaitUntilMouseTargetChanged(1, 1);
+ g_assert(webkit_hit_test_result_context_is_link(hitTestResult));
+ g_assert(!webkit_hit_test_result_context_is_image(hitTestResult));
+ g_assert(!webkit_hit_test_result_context_is_media(hitTestResult));
+ g_assert_cmpstr(webkit_hit_test_result_get_link_uri(hitTestResult), ==, "http://www.webkitgtk.org/");
+ g_assert_cmpstr(webkit_hit_test_result_get_link_title(hitTestResult), ==, "WebKitGTK+ Title");
+ g_assert_cmpstr(webkit_hit_test_result_get_link_label(hitTestResult), ==, "WebKitGTK+ Website");
+ g_assert(!test->m_mouseTargetModifiers);
+
+ // Move out of the link.
+ hitTestResult = test->moveMouseAndWaitUntilMouseTargetChanged(0, 0);
+ g_assert(!webkit_hit_test_result_context_is_link(hitTestResult));
+ g_assert(!webkit_hit_test_result_context_is_image(hitTestResult));
+ g_assert(!webkit_hit_test_result_context_is_media(hitTestResult));
+ g_assert(!test->m_mouseTargetModifiers);
+
+ // Move over image with GDK_CONTROL_MASK.
+ hitTestResult = test->moveMouseAndWaitUntilMouseTargetChanged(1, 10, GDK_CONTROL_MASK);
+ g_assert(!webkit_hit_test_result_context_is_link(hitTestResult));
+ g_assert(webkit_hit_test_result_context_is_image(hitTestResult));
+ g_assert(!webkit_hit_test_result_context_is_media(hitTestResult));
+ g_assert_cmpstr(webkit_hit_test_result_get_image_uri(hitTestResult), ==, "file:///0xdeadbeef");
+ g_assert(test->m_mouseTargetModifiers & GDK_CONTROL_MASK);
+
+ // Move over image link.
+ hitTestResult = test->moveMouseAndWaitUntilMouseTargetChanged(1, 20);
+ g_assert(webkit_hit_test_result_context_is_link(hitTestResult));
+ g_assert(webkit_hit_test_result_context_is_image(hitTestResult));
+ g_assert(!webkit_hit_test_result_context_is_media(hitTestResult));
+ g_assert_cmpstr(webkit_hit_test_result_get_link_uri(hitTestResult), ==, "http://www.webkitgtk.org/logo");
+ g_assert_cmpstr(webkit_hit_test_result_get_image_uri(hitTestResult), ==, "file:///0xdeadbeef");
+ g_assert_cmpstr(webkit_hit_test_result_get_link_title(hitTestResult), ==, "WebKitGTK+ Logo");
+ g_assert(!webkit_hit_test_result_get_link_label(hitTestResult));
+ g_assert(!test->m_mouseTargetModifiers);
+
+ // Move over media.
+ hitTestResult = test->moveMouseAndWaitUntilMouseTargetChanged(1, 30);
+ g_assert(!webkit_hit_test_result_context_is_link(hitTestResult));
+ g_assert(!webkit_hit_test_result_context_is_image(hitTestResult));
+ g_assert(webkit_hit_test_result_context_is_media(hitTestResult));
+ g_assert_cmpstr(webkit_hit_test_result_get_media_uri(hitTestResult), ==, "file:///movie.ogg");
+ g_assert(!test->m_mouseTargetModifiers);
+}
+
static void testWebViewZoomLevel(WebViewTest* test, gconstpointer)
{
g_assert_cmpfloat(webkit_web_view_get_zoom_level(test->m_webView), ==, 1);
@@ -377,6 +458,7 @@ void beforeAll()
UIClientTest::add("WebKitWebView", "create-ready-close", testWebViewCreateReadyClose);
UIClientTest::add("WebKitWebView", "javascript-dialogs", testWebViewJavaScriptDialogs);
UIClientTest::add("WebKitWebView", "window-properties", testWebViewWindowProperties);
+ UIClientTest::add("WebKitWebView", "mouse-target", testWebViewMouseTarget);
WebViewTest::add("WebKitWebView", "zoom-level", testWebViewZoomLevel);
}
diff --git a/Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.cpp b/Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.cpp
index 20895eccb..00d3b3e20 100644
--- a/Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.cpp
@@ -21,15 +21,20 @@
#include "config.h"
#include "WebViewTest.h"
+#include <WebCore/GOwnPtrGtk.h>
+
WebViewTest::WebViewTest()
: m_webView(WEBKIT_WEB_VIEW(g_object_ref_sink(webkit_web_view_new())))
, m_mainLoop(g_main_loop_new(0, TRUE))
+ , m_parentWindow(0)
{
assertObjectIsDeletedWhenTestFinishes(G_OBJECT(m_webView));
}
WebViewTest::~WebViewTest()
{
+ if (m_parentWindow)
+ gtk_widget_destroy(m_parentWindow);
g_object_unref(m_webView);
g_main_loop_unref(m_mainLoop);
}
@@ -130,3 +135,48 @@ void WebViewTest::waitUntilLoadFinished()
g_signal_connect(m_webView, "load-changed", G_CALLBACK(loadChanged), this);
g_main_loop_run(m_mainLoop);
}
+
+static gboolean parentWindowMapped(GtkWidget* widget, GdkEvent*, WebViewTest* test)
+{
+ g_signal_handlers_disconnect_by_func(widget, reinterpret_cast<void*>(parentWindowMapped), test);
+ g_main_loop_quit(test->m_mainLoop);
+
+ return FALSE;
+}
+
+void WebViewTest::showInWindowAndWaitUntilMapped()
+{
+ g_assert(!m_parentWindow);
+ m_parentWindow = gtk_window_new(GTK_WINDOW_POPUP);
+ gtk_container_add(GTK_CONTAINER(m_parentWindow), GTK_WIDGET(m_webView));
+ gtk_widget_show(GTK_WIDGET(m_webView));
+
+ g_signal_connect(m_parentWindow, "map-event", G_CALLBACK(parentWindowMapped), this);
+ gtk_widget_show(m_parentWindow);
+ g_main_loop_run(m_mainLoop);
+}
+
+void WebViewTest::mouseMoveTo(int x, int y, unsigned int mouseModifiers)
+{
+ g_assert(m_parentWindow);
+ GtkWidget* viewWidget = GTK_WIDGET(m_webView);
+ g_assert(gtk_widget_get_realized(viewWidget));
+
+ GOwnPtr<GdkEvent> event(gdk_event_new(GDK_MOTION_NOTIFY));
+ event->motion.x = x;
+ event->motion.y = y;
+
+ event->motion.time = GDK_CURRENT_TIME;
+ event->motion.window = gtk_widget_get_window(viewWidget);
+ g_object_ref(event->motion.window);
+ event->button.device = gdk_device_manager_get_client_pointer(gdk_display_get_device_manager(gtk_widget_get_display(viewWidget)));
+ event->motion.state = mouseModifiers;
+ event->motion.axes = 0;
+
+ int xRoot, yRoot;
+ gdk_window_get_root_coords(gtk_widget_get_window(viewWidget), x, y, &xRoot, &yRoot);
+ event->motion.x_root = xRoot;
+ event->motion.y_root = yRoot;
+ gtk_main_do_event(event.get());
+}
+
diff --git a/Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.h b/Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.h
index 4ad6fa648..95a569cd6 100644
--- a/Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.h
+++ b/Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.h
@@ -42,10 +42,14 @@ public:
void wait(double seconds);
void waitUntilLoadFinished();
+ void showInWindowAndWaitUntilMapped();
+
+ void mouseMoveTo(int x, int y, unsigned int mouseModifiers = 0);
WebKitWebView* m_webView;
GMainLoop* m_mainLoop;
CString m_activeURI;
+ GtkWidget* m_parentWindow;
};
#endif // WebViewTest_h
diff --git a/Source/WebKit2/UIProcess/API/gtk/webkit2.h b/Source/WebKit2/UIProcess/API/gtk/webkit2.h
index 78e53d508..f78b873a3 100644
--- a/Source/WebKit2/UIProcess/API/gtk/webkit2.h
+++ b/Source/WebKit2/UIProcess/API/gtk/webkit2.h
@@ -30,6 +30,8 @@
#include <webkit2/WebKitEditingCommands.h>
#include <webkit2/WebKitEnumTypes.h>
#include <webkit2/WebKitError.h>
+#include <webkit2/WebKitHitTestResult.h>
+#include <webkit2/WebKitPrintOperation.h>
#include <webkit2/WebKitSettings.h>
#include <webkit2/WebKitURIRequest.h>
#include <webkit2/WebKitURIResponse.h>
diff --git a/Source/WebKit2/UIProcess/API/gtk/webkit2marshal.list b/Source/WebKit2/UIProcess/API/gtk/webkit2marshal.list
index 5918d095a..77d269a75 100644
--- a/Source/WebKit2/UIProcess/API/gtk/webkit2marshal.list
+++ b/Source/WebKit2/UIProcess/API/gtk/webkit2marshal.list
@@ -10,5 +10,6 @@ BOOLEAN:UINT64
BOOLEAN:VOID
OBJECT:VOID
VOID:ENUM
+VOID:OBJECT,UINT
VOID:OBJECT,POINTER
diff --git a/Source/WebKit2/UIProcess/API/mac/WKView.mm b/Source/WebKit2/UIProcess/API/mac/WKView.mm
index 728f0e56f..d50a7269a 100644
--- a/Source/WebKit2/UIProcess/API/mac/WKView.mm
+++ b/Source/WebKit2/UIProcess/API/mac/WKView.mm
@@ -2561,6 +2561,9 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I
return;
_data->_dragHasStarted = YES;
+ IntSize size([image size]);
+ size.scale(1.0 / _data->_page->deviceScaleFactor());
+ [image setSize:size];
// The call to super could release this WKView.
RetainPtr<WKView> protector(self);
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp b/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp
index 22c6703c4..d164a6b85 100644
--- a/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp
+++ b/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp
@@ -29,6 +29,7 @@
#include <QtQuick/QQuickCanvas>
#include <QtQuick/QSGGeometryNode>
#include <QtQuick/QSGMaterial>
+#include <private/qsgrendernode_p.h>
QQuickWebPage::QQuickWebPage(QQuickWebView* viewportItem)
: QQuickItem(viewportItem)
@@ -97,7 +98,7 @@ void QQuickWebPagePrivate::paintToCurrentGLContext()
transform.scale(contentsScale, contentsScale);
float opacity = computeEffectiveOpacity(q);
- QRectF clipRect = q->parentItem()->mapRectToScene(q->parentItem()->boundingRect());
+ QRectF clipRect = viewportItem->mapRectToScene(viewportItem->boundingRect());
if (!clipRect.isValid())
return;
@@ -109,57 +110,22 @@ void QQuickWebPagePrivate::paintToCurrentGLContext()
drawingArea->paintToCurrentGLContext(transform, opacity, clipRect);
}
-struct PageProxyMaterial;
-struct PageProxyNode;
-
-// FIXME: temporary until Qt Scenegraph will support custom painting.
-struct PageProxyMaterialShader : public QSGMaterialShader {
- virtual void updateState(const RenderState& state, QSGMaterial* newMaterial, QSGMaterial* oldMaterial);
- virtual char const* const* attributeNames() const
- {
- static char const* const attr[] = { "vertex", 0 };
- return attr;
- }
-
- // vertexShader and fragmentShader are no-op shaders.
- // All real painting is gone by TextureMapper through LayerTreeHostProxy.
- virtual const char* vertexShader() const
- {
- return "attribute highp vec4 vertex; \n"
- "void main() { gl_Position = vertex; }";
- }
-
- virtual const char* fragmentShader() const
- {
- return "void main() { gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); }";
- }
-};
-
-struct PageProxyMaterial : public QSGMaterial {
- PageProxyMaterial(PageProxyNode* node) : m_node(node) { }
-
- QSGMaterialType* type() const
+struct PageProxyNode : public QSGRenderNode {
+ PageProxyNode(QQuickWebPagePrivate* page)
+ : m_pagePrivate(page)
{
- static QSGMaterialType type;
- return &type;
}
- QSGMaterialShader* createShader() const
+ virtual StateFlags changedStates()
{
- return new PageProxyMaterialShader;
+ return StateFlags(DepthState) | StencilState | ScissorState | ColorState | BlendState
+ | CullState | ViewportState;
}
- PageProxyNode* m_node;
-};
-
-struct PageProxyNode : public QSGGeometryNode {
- PageProxyNode(QQuickWebPagePrivate* page) :
- m_pagePrivate(page)
- , m_material(this)
- , m_geometry(QSGGeometry::defaultAttributes_Point2D(), 4)
+ virtual void render(const RenderState &)
{
- setGeometry(&m_geometry);
- setMaterial(&m_material);
+ if (m_pagePrivate)
+ m_pagePrivate->paintToCurrentGLContext();
}
~PageProxyNode()
@@ -169,22 +135,8 @@ struct PageProxyNode : public QSGGeometryNode {
}
QQuickWebPagePrivate* m_pagePrivate;
- PageProxyMaterial m_material;
- QSGGeometry m_geometry;
};
-void PageProxyMaterialShader::updateState(const RenderState& state, QSGMaterial* newMaterial, QSGMaterial* oldMaterial)
-{
- if (!newMaterial)
- return;
-
- PageProxyNode* node = static_cast<PageProxyMaterial*>(newMaterial)->m_node;
- // FIXME: Normally we wouldn't paint inside QSGMaterialShader::updateState,
- // but this is a temporary hack until custom paint nodes are available.
- if (node->m_pagePrivate)
- node->m_pagePrivate->paintToCurrentGLContext();
-}
-
QSGNode* QQuickWebPage::updatePaintNode(QSGNode* oldNode, UpdatePaintNodeData*)
{
if (!(flags() & ItemHasContents)) {
@@ -242,13 +194,15 @@ QTransform QQuickWebPage::transformFromItem() const
QTransform QQuickWebPage::transformToItem() const
{
- return QTransform(d->contentsScale, 0, 0, 0, d->contentsScale, 0, x(), y(), 1);
+ QPointF pos = d->viewportItem->pageItemPos();
+ return QTransform(d->contentsScale, 0, 0, 0, d->contentsScale, 0, pos.x(), pos.y(), 1);
}
void QQuickWebPagePrivate::updateSize()
{
QSizeF scaledSize = contentsSize * contentsScale;
q->setSize(scaledSize);
+ viewportItem->updateContentsSize(scaledSize);
}
void QQuickWebPagePrivate::resetPaintNode()
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp b/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
index 7ea6d347c..f40e28924 100644
--- a/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
+++ b/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
@@ -51,6 +51,7 @@
#include <WebCore/IntPoint.h>
#include <WebCore/IntRect.h>
#include <WKOpenPanelResultListener.h>
+#include <wtf/Assertions.h>
#include <wtf/text/WTFString.h>
using namespace WebCore;
@@ -66,12 +67,16 @@ static QQuickWebViewPrivate* createPrivateObject(QQuickWebView* publicObject)
QQuickWebViewPrivate::QQuickWebViewPrivate(QQuickWebView* viewport)
: q_ptr(viewport)
+ , flickProvider(0)
, alertDialog(0)
, confirmDialog(0)
, promptDialog(0)
, authenticationDialog(0)
, certificateVerificationDialog(0)
, itemSelector(0)
+ , proxyAuthenticationDialog(0)
+ , userDidOverrideContentWidth(false)
+ , userDidOverrideContentHeight(false)
, m_navigatorQtObjectEnabled(false)
, m_renderToOffscreenBuffer(false)
{
@@ -112,6 +117,7 @@ void QQuickWebViewPrivate::initialize(WKContextRef contextRef, WKPageGroupRef pa
// Any page setting should preferrable be set before creating the page.
webPageProxy->pageGroup()->preferences()->setAcceleratedCompositingEnabled(true);
webPageProxy->pageGroup()->preferences()->setForceCompositingMode(true);
+ webPageProxy->pageGroup()->preferences()->setFrameFlatteningEnabled(true);
pageClient.initialize(q_ptr, pageViewPrivate->eventHandler.data(), &undoController);
webPageProxy->initializeWebPage();
@@ -131,6 +137,12 @@ void QQuickWebViewPrivate::disableMouseEvents()
q->setAcceptHoverEvents(false);
}
+QPointF QQuickWebViewPrivate::pageItemPos()
+{
+ ASSERT(pageView);
+ return pageView->pos();
+}
+
void QQuickWebViewPrivate::loadDidSucceed()
{
Q_Q(QQuickWebView);
@@ -200,14 +212,6 @@ void QQuickWebViewPrivate::handleDownloadRequest(DownloadProxy* download)
context->downloadManager()->addDownload(download, downloadItem);
}
-void QQuickWebViewPrivate::_q_viewportTrajectoryVectorChanged(const QPointF& trajectoryVector)
-{
- DrawingAreaProxy* drawingArea = webPageProxy->drawingArea();
- if (!drawingArea)
- return;
- drawingArea->setVisibleContentRectTrajectoryVector(trajectoryVector);
-}
-
void QQuickWebViewPrivate::_q_onVisibleChanged()
{
webPageProxy->viewStateDidChange(WebPageProxy::ViewIsVisible);
@@ -301,6 +305,25 @@ void QQuickWebViewPrivate::handleAuthenticationRequiredRequest(const QString& ho
password = dialogRunner.password();
}
+void QQuickWebViewPrivate::handleProxyAuthenticationRequiredRequest(const QString& hostname, uint16_t port, const QString& prefilledUsername, QString& username, QString& password)
+{
+ if (!proxyAuthenticationDialog)
+ return;
+
+ Q_Q(QQuickWebView);
+ QtDialogRunner dialogRunner;
+ if (!dialogRunner.initForProxyAuthentication(proxyAuthenticationDialog, q, hostname, port, prefilledUsername))
+ return;
+
+ setViewInAttachedProperties(dialogRunner.dialog());
+ disableMouseEvents();
+ dialogRunner.exec();
+ enableMouseEvents();
+
+ username = dialogRunner.username();
+ password = dialogRunner.password();
+}
+
bool QQuickWebViewPrivate::handleCertificateVerificationRequest(const QString& hostname)
{
if (!certificateVerificationDialog)
@@ -445,7 +468,7 @@ void QQuickWebViewLegacyPrivate::updateViewportSize()
// The fixed layout is handled by the FrameView and the drawing area doesn't behave differently
// whether its fixed or not. We still need to tell the drawing area which part of it
// has to be rendered on tiles, and in desktop mode it's all of it.
- webPageProxy->drawingArea()->setVisibleContentsRectAndScale(IntRect(IntPoint(), viewportSize), 1);
+ webPageProxy->drawingArea()->setVisibleContentsRectForScaling(IntRect(IntPoint(), viewportSize), 1);
}
QQuickWebViewFlickablePrivate::QQuickWebViewFlickablePrivate(QQuickWebView* viewport)
@@ -468,16 +491,52 @@ void QQuickWebViewFlickablePrivate::initialize(WKContextRef contextRef, WKPageGr
webPageProxy->setUseFixedLayout(true);
}
+QPointF QQuickWebViewFlickablePrivate::pageItemPos()
+{
+ // Flickable moves its contentItem so we need to take that position into account,
+ // as well as the potential displacement of the page on the contentItem because
+ // of additional QML items.
+ qreal xPos = flickProvider->contentItem()->x() + pageView->x();
+ qreal yPos = flickProvider->contentItem()->y() + pageView->y();
+ return QPointF(xPos, yPos);
+}
+
+void QQuickWebViewFlickablePrivate::updateContentsSize(const QSizeF& size)
+{
+ ASSERT(flickProvider);
+
+ // Make sure that the contentItem is sized to the page
+ // if the user did not add other flickable items in QML.
+ // If the user adds items in QML he has to make sure to
+ // also bind the contentWidth and contentHeight accordingly.
+ // This is in accordance with normal QML Flickable behaviour.
+ if (!userDidOverrideContentWidth)
+ flickProvider->setContentWidth(size.width());
+ if (!userDidOverrideContentHeight)
+ flickProvider->setContentHeight(size.height());
+}
+
void QQuickWebViewFlickablePrivate::onComponentComplete()
{
Q_Q(QQuickWebView);
- interactionEngine.reset(new QtViewportInteractionEngine(q, pageView.data()));
+
+ ASSERT(!flickProvider);
+ flickProvider = new QtFlickProvider(q, pageView.data());
+
+ // Propagate flickable signals.
+ const QQuickWebViewExperimental* experimental = q->experimental();
+ QObject::connect(flickProvider, SIGNAL(contentWidthChanged()), experimental, SIGNAL(contentWidthChanged()));
+ QObject::connect(flickProvider, SIGNAL(contentHeightChanged()), experimental, SIGNAL(contentHeightChanged()));
+ QObject::connect(flickProvider, SIGNAL(contentXChanged()), experimental, SIGNAL(contentXChanged()));
+ QObject::connect(flickProvider, SIGNAL(contentYChanged()), experimental, SIGNAL(contentYChanged()));
+
+ interactionEngine.reset(new QtViewportInteractionEngine(q, pageView.data(), flickProvider));
pageView->eventHandler()->setViewportInteractionEngine(interactionEngine.data());
QObject::connect(interactionEngine.data(), SIGNAL(contentSuspendRequested()), q, SLOT(_q_suspend()));
QObject::connect(interactionEngine.data(), SIGNAL(contentResumeRequested()), q, SLOT(_q_resume()));
- QObject::connect(interactionEngine.data(), SIGNAL(viewportTrajectoryVectorChanged(const QPointF&)), q, SLOT(_q_viewportTrajectoryVectorChanged(const QPointF&)));
- QObject::connect(interactionEngine.data(), SIGNAL(visibleContentRectAndScaleChanged()), q, SLOT(_q_updateVisibleContentRectAndScale()));
+ QObject::connect(interactionEngine.data(), SIGNAL(contentWasMoved(const QPointF&)), q, SLOT(_q_commitPositionChange(const QPointF&)));
+ QObject::connect(interactionEngine.data(), SIGNAL(contentWasScaled()), q, SLOT(_q_commitScaleChange()));
_q_resume();
@@ -533,15 +592,17 @@ void QQuickWebViewFlickablePrivate::updateViewportSize()
if (viewportSize.isEmpty() || !interactionEngine)
return;
+ flickProvider->setViewportSize(viewportSize);
+
// Let the WebProcess know about the new viewport size, so that
// it can resize the content accordingly.
webPageProxy->setViewportSize(viewportSize);
interactionEngine->applyConstraints(computeViewportConstraints());
- _q_updateVisibleContentRectAndScale();
+ _q_commitScaleChange();
}
-void QQuickWebViewFlickablePrivate::_q_updateVisibleContentRectAndScale()
+void QQuickWebViewFlickablePrivate::_q_commitScaleChange()
{
DrawingAreaProxy* drawingArea = webPageProxy->drawingArea();
if (!drawingArea)
@@ -551,12 +612,31 @@ void QQuickWebViewFlickablePrivate::_q_updateVisibleContentRectAndScale()
const QRectF visibleRectInCSSCoordinates = q->mapRectToWebContent(q->boundingRect()).intersected(pageView->boundingRect());
float scale = pageView->contentsScale();
+ // This is only for our QML ViewportInfo debugging API.
+ q->experimental()->viewportInfo()->didUpdateCurrentScale();
+
QRect alignedVisibleContentRect = visibleRectInCSSCoordinates.toAlignedRect();
- drawingArea->setVisibleContentsRectAndScale(alignedVisibleContentRect, scale);
+ drawingArea->setVisibleContentsRectForScaling(alignedVisibleContentRect, scale);
+
+ webPageProxy->setFixedVisibleContentRect(alignedVisibleContentRect);
+}
+
+void QQuickWebViewPrivate::_q_commitPositionChange(const QPointF& trajectoryVector)
+{
+ DrawingAreaProxy* drawingArea = webPageProxy->drawingArea();
+ if (!drawingArea)
+ return;
+
+ Q_Q(QQuickWebView);
+ const QRectF visibleRectInCSSCoordinates = q->mapRectToWebContent(q->boundingRect()).intersected(pageView->boundingRect());
+
+ QRect alignedVisibleContentRect = visibleRectInCSSCoordinates.toAlignedRect();
+ drawingArea->setVisibleContentsRectForPanning(alignedVisibleContentRect, trajectoryVector);
+
+ if (!trajectoryVector.isNull())
+ return;
- // FIXME: Once we support suspend and resume, this should be delayed until the page is active if the page is suspended.
webPageProxy->setFixedVisibleContentRect(alignedVisibleContentRect);
- q->experimental()->viewportInfo()->didUpdateCurrentScale();
}
void QQuickWebViewFlickablePrivate::_q_suspend()
@@ -576,7 +656,8 @@ void QQuickWebViewFlickablePrivate::_q_resume()
postTransitionState->apply();
}
- _q_updateVisibleContentRectAndScale();
+ // FIXME: Revise this.
+ _q_commitScaleChange();
}
void QQuickWebViewFlickablePrivate::pageDidRequestScroll(const QPoint& pos)
@@ -794,6 +875,20 @@ void QQuickWebViewExperimental::setAuthenticationDialog(QDeclarativeComponent* a
emit authenticationDialogChanged();
}
+QDeclarativeComponent* QQuickWebViewExperimental::proxyAuthenticationDialog() const
+{
+ Q_D(const QQuickWebView);
+ return d->proxyAuthenticationDialog;
+}
+
+void QQuickWebViewExperimental::setProxyAuthenticationDialog(QDeclarativeComponent* proxyAuthenticationDialog)
+{
+ Q_D(QQuickWebView);
+ if (d->proxyAuthenticationDialog == proxyAuthenticationDialog)
+ return;
+ d->proxyAuthenticationDialog = proxyAuthenticationDialog;
+ emit proxyAuthenticationDialogChanged();
+}
QDeclarativeComponent* QQuickWebViewExperimental::certificateVerificationDialog() const
{
Q_D(const QQuickWebView);
@@ -910,6 +1005,78 @@ QQuickWebPage* QQuickWebViewExperimental::page()
return q_ptr->page();
}
+QDeclarativeListProperty<QObject> QQuickWebViewExperimental::flickableData()
+{
+ Q_D(const QQuickWebView);
+ ASSERT(d->flickProvider);
+ return d->flickProvider->flickableData();
+}
+
+QQuickItem* QQuickWebViewExperimental::contentItem()
+{
+ Q_D(QQuickWebView);
+ ASSERT(d->flickProvider);
+ return d->flickProvider->contentItem();
+}
+
+qreal QQuickWebViewExperimental::contentWidth() const
+{
+ Q_D(const QQuickWebView);
+ ASSERT(d->flickProvider);
+ return d->flickProvider->contentWidth();
+}
+
+void QQuickWebViewExperimental::setContentWidth(qreal width)
+{
+ Q_D(QQuickWebView);
+ ASSERT(d->flickProvider);
+ d->userDidOverrideContentWidth = true;
+ d->flickProvider->setContentWidth(width);
+}
+
+qreal QQuickWebViewExperimental::contentHeight() const
+{
+ Q_D(const QQuickWebView);
+ ASSERT(d->flickProvider);
+ return d->flickProvider->contentHeight();
+}
+
+void QQuickWebViewExperimental::setContentHeight(qreal height)
+{
+ Q_D(QQuickWebView);
+ ASSERT(d->flickProvider);
+ d->userDidOverrideContentHeight = true;
+ d->flickProvider->setContentHeight(height);
+}
+
+qreal QQuickWebViewExperimental::contentX() const
+{
+ Q_D(const QQuickWebView);
+ ASSERT(d->flickProvider);
+ return d->flickProvider->contentX();
+}
+
+void QQuickWebViewExperimental::setContentX(qreal x)
+{
+ Q_D(QQuickWebView);
+ ASSERT(d->flickProvider);
+ d->flickProvider->setContentX(x);
+}
+
+qreal QQuickWebViewExperimental::contentY() const
+{
+ Q_D(const QQuickWebView);
+ ASSERT(d->flickProvider);
+ return d->flickProvider->contentY();
+}
+
+void QQuickWebViewExperimental::setContentY(qreal y)
+{
+ Q_D(QQuickWebView);
+ ASSERT(d->flickProvider);
+ d->flickProvider->setContentY(y);
+}
+
QQuickWebView::QQuickWebView(QQuickItem* parent)
: QQuickItem(parent)
, d_ptr(createPrivateObject(this))
@@ -1071,6 +1238,8 @@ QVariant QQuickWebView::inputMethodQuery(Qt::InputMethodQuery property) const
return QString(state.selectedText);
case Qt::ImMaximumTextLength:
return QVariant(); // No limit.
+ case Qt::ImHints:
+ return int(Qt::InputMethodHints(state.inputMethodHints));
default:
// Rely on the base implementation for ImEnabled, ImHints and ImPreferredLanguage.
return QQuickItem::inputMethodQuery(property);
@@ -1225,6 +1394,7 @@ bool QQuickWebView::event(QEvent* ev)
case QEvent::FocusOut:
case QEvent::TouchBegin:
case QEvent::TouchEnd:
+ case QEvent::TouchCancel:
case QEvent::TouchUpdate:
if (d->pageView->eventHandler()->handleEvent(ev))
return true;
@@ -1256,4 +1426,16 @@ void QQuickWebView::loadHtml(const QString& html, const QUrl& baseUrl)
d->webPageProxy->loadHTMLString(html, baseUrl.toString());
}
+QPointF QQuickWebView::pageItemPos()
+{
+ Q_D(QQuickWebView);
+ return d->pageItemPos();
+}
+
+void QQuickWebView::updateContentsSize(const QSizeF& size)
+{
+ Q_D(QQuickWebView);
+ d->updateContentsSize(size);
+}
+
#include "moc_qquickwebview_p.cpp"
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h b/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h
index 69f1cd81b..674c18fe7 100644
--- a/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h
+++ b/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h
@@ -76,6 +76,7 @@ class QWEBKIT_EXPORT QQuickWebView : public QQuickItem {
Q_PROPERTY(bool canReload READ canReload NOTIFY navigationStateChanged FINAL)
Q_ENUMS(NavigationRequestAction)
Q_ENUMS(ErrorDomain)
+ Q_ENUMS(NavigationType)
public:
enum NavigationRequestAction {
@@ -89,6 +90,16 @@ public:
HttpErrorDomain,
DownloadErrorDomain
};
+
+ enum NavigationType {
+ LinkClickedNavigation,
+ FormSubmittedNavigation,
+ BackForwardNavigation,
+ ReloadNavigation,
+ FormResubmittedNavigation,
+ OtherNavigation
+ };
+
QQuickWebView(QQuickItem* parent = 0);
virtual ~QQuickWebView();
@@ -116,6 +127,10 @@ public:
static void platformInitialize(); // Only needed by WTR.
+ // Internal API used by WebPage.
+ void updateContentsSize(const QSizeF&);
+ QPointF pageItemPos();
+
public Q_SLOTS:
void load(const QUrl&);
void loadHtml(const QString& html, const QUrl& baseUrl = QUrl());
@@ -168,8 +183,9 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_suspend());
Q_PRIVATE_SLOT(d_func(), void _q_resume());
- Q_PRIVATE_SLOT(d_func(), void _q_viewportTrajectoryVectorChanged(const QPointF&));
- Q_PRIVATE_SLOT(d_func(), void _q_updateVisibleContentRectAndScale());
+ Q_PRIVATE_SLOT(d_func(), void _q_commitPositionChange(const QPointF&));
+ Q_PRIVATE_SLOT(d_func(), void _q_commitScaleChange());
+
Q_PRIVATE_SLOT(d_func(), void _q_onOpenPanelFilesSelected());
Q_PRIVATE_SLOT(d_func(), void _q_onOpenPanelFinished(int result));
Q_PRIVATE_SLOT(d_func(), void _q_onVisibleChanged());
@@ -209,11 +225,21 @@ QML_DECLARE_TYPEINFO(QQuickWebView, QML_HAS_ATTACHED_PROPERTIES)
class QWEBKIT_EXPORT QQuickWebViewExperimental : public QObject {
Q_OBJECT
Q_PROPERTY(QQuickWebPage* page READ page CONSTANT FINAL)
+
+ // QML Flickable API.
+ Q_PROPERTY(qreal contentWidth READ contentWidth WRITE setContentWidth NOTIFY contentWidthChanged)
+ Q_PROPERTY(qreal contentHeight READ contentHeight WRITE setContentHeight NOTIFY contentHeightChanged)
+ Q_PROPERTY(qreal contentX READ contentX WRITE setContentX NOTIFY contentXChanged)
+ Q_PROPERTY(qreal contentY READ contentY WRITE setContentY NOTIFY contentYChanged)
+ Q_PROPERTY(QQuickItem* contentItem READ contentItem CONSTANT)
+ Q_PROPERTY(QDeclarativeListProperty<QObject> flickableData READ flickableData)
+
Q_PROPERTY(QWebNavigationHistory* navigationHistory READ navigationHistory CONSTANT FINAL)
Q_PROPERTY(QDeclarativeComponent* alertDialog READ alertDialog WRITE setAlertDialog NOTIFY alertDialogChanged)
Q_PROPERTY(QDeclarativeComponent* confirmDialog READ confirmDialog WRITE setConfirmDialog NOTIFY confirmDialogChanged)
Q_PROPERTY(QDeclarativeComponent* promptDialog READ promptDialog WRITE setPromptDialog NOTIFY promptDialogChanged)
Q_PROPERTY(QDeclarativeComponent* authenticationDialog READ authenticationDialog WRITE setAuthenticationDialog NOTIFY authenticationDialogChanged)
+ Q_PROPERTY(QDeclarativeComponent* proxyAuthenticationDialog READ proxyAuthenticationDialog WRITE setProxyAuthenticationDialog NOTIFY proxyAuthenticationDialogChanged)
Q_PROPERTY(QDeclarativeComponent* certificateVerificationDialog READ certificateVerificationDialog WRITE setCertificateVerificationDialog NOTIFY certificateVerificationDialogChanged)
Q_PROPERTY(QDeclarativeComponent* itemSelector READ itemSelector WRITE setItemSelector NOTIFY itemSelectorChanged)
Q_PROPERTY(QWebPreferences* preferences READ preferences CONSTANT FINAL)
@@ -241,6 +267,8 @@ public:
void setCertificateVerificationDialog(QDeclarativeComponent*);
QDeclarativeComponent* itemSelector() const;
void setItemSelector(QDeclarativeComponent*);
+ QDeclarativeComponent* proxyAuthenticationDialog() const;
+ void setProxyAuthenticationDialog(QDeclarativeComponent*);
QWebViewportInfo* viewportInfo();
@@ -253,9 +281,20 @@ public:
static int schemeDelegates_Count(QDeclarativeListProperty<QQuickUrlSchemeDelegate>*);
static void schemeDelegates_Clear(QDeclarativeListProperty<QQuickUrlSchemeDelegate>*);
QDeclarativeListProperty<QQuickUrlSchemeDelegate> schemeDelegates();
+ QDeclarativeListProperty<QObject> flickableData();
void invokeApplicationSchemeHandler(WTF::PassRefPtr<WebKit::QtRefCountedNetworkRequestData>);
void sendApplicationSchemeReply(QQuickNetworkReply*);
+ QQuickItem* contentItem();
+ qreal contentWidth() const;
+ void setContentWidth(qreal);
+ qreal contentHeight() const;
+ void setContentHeight(qreal);
+ qreal contentX() const;
+ void setContentX(qreal);
+ qreal contentY() const;
+ void setContentY(qreal);
+
// C++ only
bool renderToOffscreenBuffer() const;
void setRenderToOffscreenBuffer(bool enable);
@@ -268,6 +307,10 @@ public Q_SLOTS:
void postMessage(const QString&);
Q_SIGNALS:
+ void contentWidthChanged();
+ void contentHeightChanged();
+ void contentXChanged();
+ void contentYChanged();
void alertDialogChanged();
void confirmDialogChanged();
void promptDialogChanged();
@@ -277,6 +320,7 @@ Q_SIGNALS:
void downloadRequested(QWebDownloadItem* downloadItem);
void permissionRequested(QWebPermissionRequest* permission);
void messageReceived(const QVariantMap& message);
+ void proxyAuthenticationDialogChanged();
private:
QQuickWebView* q_ptr;
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h b/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h
index 9e27ce322..300b4759d 100644
--- a/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h
+++ b/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h
@@ -22,6 +22,7 @@
#define qquickwebview_p_p_h
#include "DrawingAreaProxy.h"
+#include "QtFlickProvider.h"
#include "QtPageClient.h"
#include "QtViewportInteractionEngine.h"
#include "QtWebPageLoadClient.h"
@@ -68,6 +69,9 @@ public:
void enableMouseEvents();
void disableMouseEvents();
+ virtual QPointF pageItemPos();
+ virtual void updateContentsSize(const QSizeF&) { }
+
virtual void loadDidSucceed();
virtual void onComponentComplete() { }
virtual void loadDidCommit() { }
@@ -80,11 +84,13 @@ public:
virtual QtViewportInteractionEngine* viewportInteractionEngine() { return 0; }
virtual void updateViewportSize() { }
void updateTouchViewportSize();
- virtual void _q_updateVisibleContentRectAndScale() { }
virtual void _q_suspend() { }
virtual void _q_resume() { }
- void _q_viewportTrajectoryVectorChanged(const QPointF&);
+
+ virtual void _q_commitScaleChange() { }
+ void _q_commitPositionChange(const QPointF&);
+
void _q_onOpenPanelFilesSelected();
void _q_onOpenPanelFinished(int result);
void _q_onVisibleChanged();
@@ -98,6 +104,7 @@ public:
void handleAuthenticationRequiredRequest(const QString& hostname, const QString& realm, const QString& prefilledUsername, QString& username, QString& password);
bool handleCertificateVerificationRequest(const QString& hostname);
+ void handleProxyAuthenticationRequiredRequest(const QString& hostname, uint16_t port, const QString& prefilledUsername, QString& username, QString& password);
void setRenderToOffscreenBuffer(bool enable) { m_renderToOffscreenBuffer = enable; }
void setViewInAttachedProperties(QObject*);
@@ -133,6 +140,7 @@ protected:
QScopedPointer<QQuickWebPage> pageView;
QQuickWebView* q_ptr;
+ QtFlickProvider* flickProvider;
QDeclarativeComponent* alertDialog;
QDeclarativeComponent* confirmDialog;
@@ -140,11 +148,14 @@ protected:
QDeclarativeComponent* authenticationDialog;
QDeclarativeComponent* certificateVerificationDialog;
QDeclarativeComponent* itemSelector;
+ QDeclarativeComponent* proxyAuthenticationDialog;
WebCore::ViewportArguments viewportArguments;
QFileDialog* fileDialog;
WKOpenPanelResultListenerRef openPanelResultListener;
+ bool userDidOverrideContentWidth;
+ bool userDidOverrideContentHeight;
bool m_navigatorQtObjectEnabled;
bool m_renderToOffscreenBuffer;
QUrl m_iconURL;
@@ -166,6 +177,9 @@ public:
virtual ~QQuickWebViewFlickablePrivate();
virtual void initialize(WKContextRef contextRef = 0, WKPageGroupRef pageGroupRef = 0);
+ virtual QPointF pageItemPos();
+ virtual void updateContentsSize(const QSizeF&);
+
virtual void loadDidSucceed();
virtual void onComponentComplete();
virtual void loadDidCommit();
@@ -173,9 +187,10 @@ public:
virtual void didChangeViewportProperties(const WebCore::ViewportArguments& args);
virtual QtViewportInteractionEngine* viewportInteractionEngine() { return interactionEngine.data(); }
virtual void updateViewportSize();
- virtual void _q_updateVisibleContentRectAndScale();
+
virtual void _q_suspend();
virtual void _q_resume();
+ virtual void _q_commitScaleChange();
virtual void pageDidRequestScroll(const QPoint& pos);
virtual void didChangeContentsSize(const QSize& newSize);
diff --git a/Source/WebKit2/UIProcess/API/qt/qtwebsecurityorigin.cpp b/Source/WebKit2/UIProcess/API/qt/qtwebsecurityorigin.cpp
new file mode 100644
index 000000000..4491dc40a
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/qt/qtwebsecurityorigin.cpp
@@ -0,0 +1,60 @@
+/*
+ Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "qtwebsecurityorigin_p.h"
+
+#include <QtCore/QFileInfo>
+#include <QtCore/QStringList>
+#include <SchemeRegistry.h>
+#include <SecurityOrigin.h>
+#include <WebKit2/WKBase.h>
+#include <WebKit2/WKRetainPtr.h>
+#include <WebKit2/WKSecurityOrigin.h>
+
+using namespace WebCore;
+
+QtWebSecurityOrigin::QtWebSecurityOrigin(QObject* parent)
+ : QObject(parent)
+{
+}
+
+QtWebSecurityOrigin::~QtWebSecurityOrigin()
+{
+}
+
+QString QtWebSecurityOrigin::host() const
+{
+ return m_url.host();
+}
+
+QString QtWebSecurityOrigin::scheme() const
+{
+ return m_url.scheme();
+}
+
+QString QtWebSecurityOrigin::path() const
+{
+ return m_url.path();
+}
+
+int QtWebSecurityOrigin::port() const
+{
+ return m_url.port();
+}
diff --git a/Source/WebKit2/UIProcess/API/qt/qtwebsecurityorigin_p.h b/Source/WebKit2/UIProcess/API/qt/qtwebsecurityorigin_p.h
new file mode 100644
index 000000000..df09fb8ea
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/qt/qtwebsecurityorigin_p.h
@@ -0,0 +1,57 @@
+/*
+ Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+#ifndef qtwebsecurityorigin_p_h
+#define qtwebsecurityorigin_p_h
+
+#include "qwebkitglobal.h"
+
+#include <QtCore/QDataStream>
+#include <QtCore/QObject>
+#include <QtCore/QString>
+#include <QtCore/QUrl>
+#include <QtCore/qshareddata.h>
+
+class QWEBKIT_EXPORT QtWebSecurityOrigin : public QObject {
+ Q_OBJECT
+ Q_PROPERTY(QString scheme READ scheme CONSTANT)
+ Q_PROPERTY(QString host READ host CONSTANT)
+ Q_PROPERTY(int port READ port CONSTANT)
+ Q_PROPERTY(QString path READ path CONSTANT)
+
+public:
+ QtWebSecurityOrigin(QObject* parent = 0);
+ virtual ~QtWebSecurityOrigin();
+
+ QString scheme() const;
+ QString host() const;
+ int port() const;
+ QString path() const;
+
+ // Used to set security information in a permission request event (e.g.
+ // geolocation permission)
+ void setScheme(const QString& scheme) { m_url.setScheme(scheme); }
+ void setHost(const QString& host) { m_url.setHost(host); }
+ void setPath(const QString& path) { m_url.setPath(path); }
+ void setPort(int port) { m_url.setPort(port); }
+
+private:
+ QUrl m_url;
+};
+
+#endif // qtwebsecurityorigin_p_h
diff --git a/Source/WebKit2/UIProcess/API/qt/qwebnavigationrequest.cpp b/Source/WebKit2/UIProcess/API/qt/qwebnavigationrequest.cpp
index 5208a061c..3a63f80e3 100644
--- a/Source/WebKit2/UIProcess/API/qt/qwebnavigationrequest.cpp
+++ b/Source/WebKit2/UIProcess/API/qt/qwebnavigationrequest.cpp
@@ -25,12 +25,14 @@
class QWebNavigationRequestPrivate {
public:
- QWebNavigationRequestPrivate(const QUrl& url, const QUrl& originatingUrl, Qt::MouseButton button, Qt::KeyboardModifiers modifiers)
+ QWebNavigationRequestPrivate(const QUrl& url, const QUrl& originatingUrl, Qt::MouseButton button,
+ Qt::KeyboardModifiers modifiers, QQuickWebView::NavigationType navigationType)
: url(url)
, originatingUrl(originatingUrl)
, button(button)
, modifiers(modifiers)
, action(QQuickWebView::AcceptRequest)
+ , navigationType(navigationType)
{
}
@@ -43,11 +45,13 @@ public:
Qt::MouseButton button;
Qt::KeyboardModifiers modifiers;
int action;
+ QQuickWebView::NavigationType navigationType;
};
-QWebNavigationRequest::QWebNavigationRequest(const QUrl& url, const QUrl& originatingUrl, Qt::MouseButton button, Qt::KeyboardModifiers modifiers, QObject* parent)
+QWebNavigationRequest::QWebNavigationRequest(const QUrl& url, const QUrl& originatingUrl, Qt::MouseButton button,
+ Qt::KeyboardModifiers modifiers, QQuickWebView::NavigationType navigationType, QObject* parent)
: QObject(parent)
- , d(new QWebNavigationRequestPrivate(url, originatingUrl, button, modifiers))
+ , d(new QWebNavigationRequestPrivate(url, originatingUrl, button, modifiers, navigationType))
{
}
@@ -90,3 +94,7 @@ int QWebNavigationRequest::action() const
return int(d->action);
}
+QQuickWebView::NavigationType QWebNavigationRequest::navigationType() const
+{
+ return d->navigationType;
+}
diff --git a/Source/WebKit2/UIProcess/API/qt/qwebnavigationrequest_p.h b/Source/WebKit2/UIProcess/API/qt/qwebnavigationrequest_p.h
index 986b1c12d..46333f0e8 100644
--- a/Source/WebKit2/UIProcess/API/qt/qwebnavigationrequest_p.h
+++ b/Source/WebKit2/UIProcess/API/qt/qwebnavigationrequest_p.h
@@ -20,6 +20,7 @@
#ifndef qwebnavigationrequest_p_h
#define qwebnavigationrequest_p_h
+#include "qquickwebview_p.h"
#include "qwebkitglobal.h"
#include <QtCore/QObject>
@@ -34,9 +35,11 @@ class QWEBKIT_EXPORT QWebNavigationRequest : public QObject {
Q_PROPERTY(int button READ button CONSTANT FINAL)
Q_PROPERTY(int modifiers READ modifiers CONSTANT FINAL)
Q_PROPERTY(int action READ action WRITE setAction NOTIFY actionChanged FINAL)
+ Q_PROPERTY(QQuickWebView::NavigationType navigationType READ navigationType CONSTANT FINAL)
public:
- QWebNavigationRequest(const QUrl& url, const QUrl& originatingUrl, Qt::MouseButton button, Qt::KeyboardModifiers modifiers, QObject* parent = 0);
+ QWebNavigationRequest(const QUrl& url, const QUrl& originatingUrl, Qt::MouseButton button, Qt::KeyboardModifiers modifiers,
+ QQuickWebView::NavigationType navigationType, QObject* parent = 0);
~QWebNavigationRequest();
QUrl url() const;
@@ -46,6 +49,7 @@ public:
int action() const;
void setAction(int action);
+ QQuickWebView::NavigationType navigationType() const;
Q_SIGNALS:
void actionChanged();
diff --git a/Source/WebKit2/UIProcess/API/qt/qwebpermissionrequest.cpp b/Source/WebKit2/UIProcess/API/qt/qwebpermissionrequest.cpp
index 16a438560..c4c1af825 100644
--- a/Source/WebKit2/UIProcess/API/qt/qwebpermissionrequest.cpp
+++ b/Source/WebKit2/UIProcess/API/qt/qwebpermissionrequest.cpp
@@ -34,7 +34,15 @@ public:
, request(permissionRequest)
, allow(false)
{
+ WKRetainPtr<WKStringRef> url = adoptWK(WKSecurityOriginCopyProtocol(origin.get()));
+ securityInfo.setScheme(WKStringCopyQString(url.get()));
+
+ WKRetainPtr<WKStringRef> host = adoptWK(WKSecurityOriginCopyHost(origin.get()));
+ securityInfo.setHost(WKStringCopyQString(host.get()));
+
+ securityInfo.setPort(static_cast<int>(WKSecurityOriginGetPort(origin.get())));
}
+
~QWebPermissionRequestPrivate()
{
}
@@ -42,6 +50,7 @@ public:
WKRetainPtr<WKSecurityOriginRef> origin;
QWebPermissionRequest::RequestType type;
WKRetainPtr<WKGeolocationPermissionRequestRef> request;
+ QtWebSecurityOrigin securityInfo;
bool allow;
};
@@ -88,19 +97,8 @@ bool QWebPermissionRequest::allow() const
return d->allow;
}
-QString QWebPermissionRequest::scheme() const
-{
- WKRetainPtr<WKStringRef> url = adoptWK(WKSecurityOriginCopyProtocol(d->origin.get()));
- return WKStringCopyQString(url.get());
-}
-
-QString QWebPermissionRequest::host() const
+QtWebSecurityOrigin* QWebPermissionRequest::securityOrigin()
{
- WKRetainPtr<WKStringRef> origin = adoptWK(WKSecurityOriginCopyHost(d->origin.get()));
- return WKStringCopyQString(origin.get());
+ return &(d->securityInfo);
}
-int QWebPermissionRequest::port() const
-{
- return static_cast<int>(WKSecurityOriginGetPort(d->origin.get()));
-}
diff --git a/Source/WebKit2/UIProcess/API/qt/qwebpermissionrequest_p.h b/Source/WebKit2/UIProcess/API/qt/qwebpermissionrequest_p.h
index 5824c4ccd..4708b71a6 100644
--- a/Source/WebKit2/UIProcess/API/qt/qwebpermissionrequest_p.h
+++ b/Source/WebKit2/UIProcess/API/qt/qwebpermissionrequest_p.h
@@ -20,6 +20,7 @@
#ifndef qwebpermissionrequest_p_h
#define qwebpermissionrequest_p_h
+#include "qtwebsecurityorigin_p.h"
#include "qwebkitglobal.h"
#include <QtCore/QObject>
@@ -32,10 +33,8 @@ class QWebPermissionRequestPrivate;
class QWEBKIT_EXPORT QWebPermissionRequest : public QObject {
Q_OBJECT
Q_PROPERTY(bool allow READ allow WRITE setAllow)
- Q_PROPERTY(RequestType type READ type)
- Q_PROPERTY(QString scheme READ scheme)
- Q_PROPERTY(QString host READ host)
- Q_PROPERTY(int port READ port)
+ Q_PROPERTY(RequestType type READ type CONSTANT)
+ Q_PROPERTY(QtWebSecurityOrigin* origin READ securityOrigin)
Q_ENUMS(RequestType)
public:
@@ -48,12 +47,10 @@ public:
RequestType type() const;
bool allow() const;
- QString scheme() const;
- QString host() const;
- int port() const;
public Q_SLOTS:
void setAllow(bool);
+ QtWebSecurityOrigin* securityOrigin();
private:
friend class QWebPermissionRequestPrivate;
diff --git a/Source/WebKit2/UIProcess/API/qt/qwebpreferences.cpp b/Source/WebKit2/UIProcess/API/qt/qwebpreferences.cpp
index 71c11afe5..835c698db 100644
--- a/Source/WebKit2/UIProcess/API/qt/qwebpreferences.cpp
+++ b/Source/WebKit2/UIProcess/API/qt/qwebpreferences.cpp
@@ -54,6 +54,8 @@ bool QWebPreferencesPrivate::testAttribute(QWebPreferencesPrivate::WebAttribute
return WKPreferencesGetPrivateBrowsingEnabled(preferencesRef());
case DnsPrefetchEnabled:
return WKPreferencesGetDNSPrefetchingEnabled(preferencesRef());
+ case FrameFlatteningEnabled:
+ return WKPreferencesGetFrameFlatteningEnabled(preferencesRef());
default:
ASSERT_NOT_REACHED();
return false;
@@ -87,6 +89,9 @@ void QWebPreferencesPrivate::setAttribute(QWebPreferencesPrivate::WebAttribute a
case DnsPrefetchEnabled:
WKPreferencesSetDNSPrefetchingEnabled(preferencesRef(), enable);
break;
+ case FrameFlatteningEnabled:
+ WKPreferencesSetFrameFlatteningEnabled(preferencesRef(), enable);
+ break;
default:
ASSERT_NOT_REACHED();
}
@@ -293,6 +298,17 @@ void QWebPreferences::setNavigatorQtObjectEnabled(bool enable)
emit navigatorQtObjectEnabledChanged();
}
+bool QWebPreferences::frameFlatteningEnabled() const
+{
+ return d->testAttribute(QWebPreferencesPrivate::FrameFlatteningEnabled);
+}
+
+void QWebPreferences::setFrameFlatteningEnabled(bool enable)
+{
+ d->setAttribute(QWebPreferencesPrivate::FrameFlatteningEnabled, enable);
+ emit frameFlatteningEnabledChanged();
+}
+
QString QWebPreferences::standardFontFamily() const
{
return d->fontFamily(QWebPreferencesPrivate::StandardFont);
diff --git a/Source/WebKit2/UIProcess/API/qt/qwebpreferences_p.h b/Source/WebKit2/UIProcess/API/qt/qwebpreferences_p.h
index 29df04cea..82b738fbf 100644
--- a/Source/WebKit2/UIProcess/API/qt/qwebpreferences_p.h
+++ b/Source/WebKit2/UIProcess/API/qt/qwebpreferences_p.h
@@ -40,6 +40,7 @@ public:
Q_PROPERTY(bool privateBrowsingEnabled READ privateBrowsingEnabled WRITE setPrivateBrowsingEnabled NOTIFY privateBrowsingEnabledChanged FINAL)
Q_PROPERTY(bool dnsPrefetchEnabled READ dnsPrefetchEnabled WRITE setDnsPrefetchEnabled NOTIFY dnsPrefetchEnabledChanged FINAL)
Q_PROPERTY(bool navigatorQtObjectEnabled READ navigatorQtObjectEnabled WRITE setNavigatorQtObjectEnabled NOTIFY navigatorQtObjectEnabledChanged FINAL)
+ Q_PROPERTY(bool frameFlatteningEnabled READ frameFlatteningEnabled WRITE setFrameFlatteningEnabled NOTIFY frameFlatteningEnabledChanged FINAL)
Q_PROPERTY(QString standardFontFamily READ standardFontFamily WRITE setStandardFontFamily NOTIFY standardFontFamilyChanged FINAL)
Q_PROPERTY(QString fixedFontFamily READ fixedFontFamily WRITE setFixedFontFamily NOTIFY fixedFontFamilyChanged FINAL)
@@ -79,6 +80,9 @@ public:
bool navigatorQtObjectEnabled() const;
void setNavigatorQtObjectEnabled(bool);
+ bool frameFlatteningEnabled() const;
+ void setFrameFlatteningEnabled(bool enable);
+
QString standardFontFamily() const;
void setStandardFontFamily(const QString& family);
@@ -116,6 +120,7 @@ Q_SIGNALS:
void privateBrowsingEnabledChanged();
void dnsPrefetchEnabledChanged();
void navigatorQtObjectEnabledChanged();
+ void frameFlatteningEnabledChanged();
void standardFontFamilyChanged();
void fixedFontFamilyChanged();
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/bytearraytestdata.h b/Source/WebKit2/UIProcess/API/qt/tests/bytearraytestdata.h
index 7170f6594..f7838f072 100644
--- a/Source/WebKit2/UIProcess/API/qt/tests/bytearraytestdata.h
+++ b/Source/WebKit2/UIProcess/API/qt/tests/bytearraytestdata.h
@@ -33,6 +33,7 @@ class QWEBKIT_EXPORT ByteArrayTestData : public QObject {
public:
ByteArrayTestData(QObject* parent = 0);
+ virtual ~ByteArrayTestData() { }
QVariant latin1Data() const;
QVariant utf8Data() const;
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp b/Source/WebKit2/UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp
index f1a81bc18..3ad4729a9 100644
--- a/Source/WebKit2/UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp
+++ b/Source/WebKit2/UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp
@@ -43,6 +43,12 @@ static QStringList expectedAPI = QStringList()
<< "QQuickWebView.NetworkErrorDomain --> ErrorDomain"
<< "QQuickWebView.HttpErrorDomain --> ErrorDomain"
<< "QQuickWebView.DownloadErrorDomain --> ErrorDomain"
+ << "QQuickWebView.LinkClickedNavigation --> NavigationType"
+ << "QQuickWebView.FormSubmittedNavigation --> NavigationType"
+ << "QQuickWebView.BackForwardNavigation --> NavigationType"
+ << "QQuickWebView.ReloadNavigation --> NavigationType"
+ << "QQuickWebView.FormResubmittedNavigation --> NavigationType"
+ << "QQuickWebView.OtherNavigation --> NavigationType"
<< "QQuickWebView.title --> QString"
<< "QQuickWebView.url --> QUrl"
<< "QQuickWebView.icon --> QUrl"
@@ -73,6 +79,7 @@ static QStringList expectedAPI = QStringList()
<< "QWebNavigationRequest.button --> int"
<< "QWebNavigationRequest.modifiers --> int"
<< "QWebNavigationRequest.action --> int"
+ << "QWebNavigationRequest.navigationType --> QQuickWebView::NavigationType"
<< "QWebNavigationRequest.actionChanged() --> void"
;
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView.pro b/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView.pro
index 8cd15ff4d..7f4e3d12f 100644
--- a/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView.pro
+++ b/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView.pro
@@ -27,4 +27,5 @@ OTHER_FILES += \
WebView/tst_preferences.qml \
WebView/tst_properties.qml \
WebView/tst_titleChanged.qml \
- WebView/tst_applicationScheme.qml
+ WebView/tst_applicationScheme.qml \
+ WebView/tst_origin.qml
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_origin.qml b/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_origin.qml
new file mode 100644
index 000000000..70745d8d6
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_origin.qml
@@ -0,0 +1,57 @@
+import QtQuick 2.0
+import QtTest 1.0
+import QtWebKit 3.0
+import QtWebKit.experimental 1.0
+
+WebView {
+ id: webView
+ width: 200
+ height: 200
+
+ property bool success: true
+ property int port: 0
+ property string scheme: "file"
+
+ SignalSpy {
+ id: spy
+ target: experimental
+ signalName: "permissionRequested"
+ }
+
+ experimental.onPermissionRequested: {
+ if (permission.origin.port != webView.port) {
+ console.log("Expected port value should be zero.")
+ webView.success = false
+ }
+
+ if (permission.origin.scheme != webView.scheme) {
+ console.log("Expected scheme should be \"file\".")
+ webView.success = false
+ }
+ }
+
+ TestCase {
+ name: "WebViewSecurityOrigin"
+
+ // Delayed windowShown to workaround problems with Qt5 in debug mode.
+ when: false
+ Timer {
+ running: parent.windowShown
+ repeat: false
+ interval: 1
+ onTriggered: parent.when = true
+ }
+
+ function init() {
+ spy.clear()
+ }
+
+ function test_permissionRequest() {
+ compare(spy.count, 0)
+ webView.load(Qt.resolvedUrl("../common/geolocation.html"))
+ spy.wait()
+ compare(spy.count, 1)
+ compare(webView.success, true)
+ }
+ }
+}
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/qmltests/tst_qmltests.cpp b/Source/WebKit2/UIProcess/API/qt/tests/qmltests/tst_qmltests.cpp
index a80c5c389..bcc246db4 100644
--- a/Source/WebKit2/UIProcess/API/qt/tests/qmltests/tst_qmltests.cpp
+++ b/Source/WebKit2/UIProcess/API/qt/tests/qmltests/tst_qmltests.cpp
@@ -21,9 +21,9 @@
#include "../util.h"
#include "qquickwebview_p.h"
+#include <QGuiApplication>
#include <QVarLengthArray>
#include <QtQuickTest/quicktest.h>
-#include <QtWidgets/QApplication>
int main(int argc, char** argv)
{
@@ -42,7 +42,7 @@ int main(int argc, char** argv)
// Instantiate QApplication to prevent quick_test_main to instantiate a QGuiApplication.
// This can be removed as soon as we do not use QtWidgets any more.
- QApplication app(argc, argv);
+ QGuiApplication app(argc, argv);
qmlRegisterType<ByteArrayTestData>("Test", 1, 0, "ByteArrayTestData");
#ifdef DISABLE_FLICKABLE_VIEWPORT
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp b/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp
index db3f9c977..12886b314 100644
--- a/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp
+++ b/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp
@@ -352,11 +352,11 @@ void tst_QQuickWebView::scrollRequest()
// COMPARE with the position requested in the html
// Use qRound as that is also used when calculating the position
// in WebKit.
- int y = -qRound(50 * webView()->page()->contentsScale());
- QVERIFY(webView()->page()->pos().y() == y);
+ int y = qRound(50 * webView()->page()->contentsScale());
+ QVERIFY(webView()->experimental()->contentY() == y);
}
-QTWEBKIT_API_TEST_MAIN(tst_QQuickWebView)
+QTEST_MAIN(tst_QQuickWebView)
#include "tst_qquickwebview.moc"
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/tests.pri b/Source/WebKit2/UIProcess/API/qt/tests/tests.pri
index ed91d3942..faf445397 100644
--- a/Source/WebKit2/UIProcess/API/qt/tests/tests.pri
+++ b/Source/WebKit2/UIProcess/API/qt/tests/tests.pri
@@ -9,7 +9,7 @@ SOURCES += ../util.cpp \
../bytearraytestdata.cpp
INCLUDEPATH += $$PWD
-QT += testlib declarative widgets quick
+QT += testlib declarative quick
CONFIG += qtwebkit
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/util.h b/Source/WebKit2/UIProcess/API/qt/tests/util.h
index 007964fe5..1c052bc9a 100644
--- a/Source/WebKit2/UIProcess/API/qt/tests/util.h
+++ b/Source/WebKit2/UIProcess/API/qt/tests/util.h
@@ -29,13 +29,3 @@
void addQtWebProcessToPath();
bool waitForSignal(QObject*, const char* signal, int timeout = 10000);
void suppressDebugOutput();
-
-#define QTWEBKIT_API_TEST_MAIN(TestObject) \
-int main(int argc, char** argv) \
-{ \
- suppressDebugOutput(); \
- QApplication app(argc, argv); \
- QTEST_DISABLE_KEYPAD_NAVIGATION \
- TestObject tc; \
- return QTest::qExec(&tc, argc, argv); \
-}
diff --git a/Source/WebKit2/UIProcess/BackingStore.h b/Source/WebKit2/UIProcess/BackingStore.h
index e83ae88d2..bd301bbe4 100644
--- a/Source/WebKit2/UIProcess/BackingStore.h
+++ b/Source/WebKit2/UIProcess/BackingStore.h
@@ -26,7 +26,7 @@
#ifndef BackingStore_h
#define BackingStore_h
-#include <WebCore/IntSize.h>
+#include <WebCore/IntRect.h>
#include <wtf/Noncopyable.h>
#include <wtf/PassOwnPtr.h>
@@ -46,10 +46,6 @@
#include <WebCore/WidgetBackingStore.h>
#endif
-namespace WebCore {
- class IntRect;
-}
-
namespace WebKit {
class ShareableBitmap;
@@ -92,8 +88,18 @@ private:
#if PLATFORM(MAC)
CGContextRef backingStoreContext();
+ void performWithScrolledRectTransform(const WebCore::IntRect&, void (^)(const WebCore::IntRect&, const WebCore::IntSize&));
+ void resetScrolledRect();
+
RetainPtr<CGLayerRef> m_cgLayer;
RetainPtr<CGContextRef> m_bitmapContext;
+
+ // The rectange that was scrolled most recently.
+ WebCore::IntRect m_scrolledRect;
+
+ // Contents of m_scrolledRect are offset by this amount (and wrapped around) with respect to
+ // their original location.
+ WebCore::IntSize m_scrolledRectOffset;
#elif PLATFORM(WIN) || PLATFORM(WIN_CAIRO)
OwnPtr<HBITMAP> m_bitmap;
#elif PLATFORM(QT)
diff --git a/Source/WebKit2/UIProcess/DrawingAreaProxy.h b/Source/WebKit2/UIProcess/DrawingAreaProxy.h
index c5b713c39..e78c3cdf0 100644
--- a/Source/WebKit2/UIProcess/DrawingAreaProxy.h
+++ b/Source/WebKit2/UIProcess/DrawingAreaProxy.h
@@ -93,8 +93,8 @@ public:
LayerTreeHostProxy* layerTreeHostProxy() const { return m_layerTreeHostProxy.get(); }
#if USE(TILED_BACKING_STORE)
- virtual void setVisibleContentsRectAndScale(const WebCore::IntRect& visibleContentsRect, float scale) { }
- virtual void setVisibleContentRectTrajectoryVector(const WebCore::FloatPoint&) { }
+ virtual void setVisibleContentsRectForScaling(const WebCore::IntRect& visibleContentsRect, float scale) { }
+ virtual void setVisibleContentsRectForPanning(const WebCore::IntRect& visibleContentsRect, const WebCore::FloatPoint& trajectoryVector) { }
virtual void createTileForLayer(int layerID, int tileID, const WebKit::UpdateInfo&) { }
virtual void updateTileForLayer(int layerID, int tileID, const WebKit::UpdateInfo&) { }
virtual void removeTileForLayer(int layerID, int tileID) { }
diff --git a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
index 24a5aed18..220f9ece2 100644
--- a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
+++ b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
@@ -348,16 +348,16 @@ void DrawingAreaProxyImpl::didReceiveLayerTreeHostProxyMessage(CoreIPC::Connecti
m_layerTreeHostProxy->didReceiveLayerTreeHostProxyMessage(connection, messageID, arguments);
}
-void DrawingAreaProxyImpl::setVisibleContentsRectAndScale(const WebCore::IntRect& visibleContentsRect, float scale)
+void DrawingAreaProxyImpl::setVisibleContentsRectForScaling(const WebCore::IntRect& visibleContentsRect, float scale)
{
if (m_layerTreeHostProxy)
- m_layerTreeHostProxy->setVisibleContentsRectAndScale(visibleContentsRect, scale);
+ m_layerTreeHostProxy->setVisibleContentsRectForScaling(visibleContentsRect, scale);
}
-void DrawingAreaProxyImpl::setVisibleContentRectTrajectoryVector(const WebCore::FloatPoint& trajectoryVector)
+void DrawingAreaProxyImpl::setVisibleContentsRectForPanning(const WebCore::IntRect& visibleContentsRect, const WebCore::FloatPoint& trajectoryVector)
{
if (m_layerTreeHostProxy)
- m_layerTreeHostProxy->setVisibleContentRectTrajectoryVector(trajectoryVector);
+ m_layerTreeHostProxy->setVisibleContentsRectForPanning(visibleContentsRect, trajectoryVector);
}
void DrawingAreaProxyImpl::paintLayerTree(BackingStore::PlatformGraphicsContext context)
diff --git a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h
index 5fcf24c50..25c279b0b 100644
--- a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h
+++ b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h
@@ -78,8 +78,8 @@ private:
bool isInAcceleratedCompositingMode() const { return !m_layerTreeContext.isEmpty(); }
#if USE(TILED_BACKING_STORE)
- virtual void setVisibleContentsRectAndScale(const WebCore::IntRect& visibleContentsRect, float scale);
- virtual void setVisibleContentRectTrajectoryVector(const WebCore::FloatPoint&);
+ virtual void setVisibleContentsRectForScaling(const WebCore::IntRect& visibleContentsRect, float scale);
+ virtual void setVisibleContentsRectForPanning(const WebCore::IntRect& visibleContentsRect, const WebCore::FloatPoint&);
virtual void paintToCurrentGLContext(const WebCore::TransformationMatrix&, float opacity, const WebCore::FloatRect&);
virtual void paintLayerTree(BackingStore::PlatformGraphicsContext);
void didReceiveLayerTreeHostProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
diff --git a/Source/WebKit2/UIProcess/Launcher/mac/ThreadLauncherMac.mm b/Source/WebKit2/UIProcess/Launcher/mac/ThreadLauncherMac.mm
index dd53b3ef1..7c011531f 100644
--- a/Source/WebKit2/UIProcess/Launcher/mac/ThreadLauncherMac.mm
+++ b/Source/WebKit2/UIProcess/Launcher/mac/ThreadLauncherMac.mm
@@ -37,7 +37,7 @@ using namespace WebCore;
namespace WebKit {
-static void* webThreadBody(void* context)
+static void webThreadBody(void* context)
{
mach_port_t serverPort = static_cast<mach_port_t>(reinterpret_cast<uintptr_t>(context));
@@ -52,8 +52,6 @@ static void* webThreadBody(void* context)
[pool drain];
RunLoop::current()->run();
-
- return 0;
}
CoreIPC::Connection::Identifier ThreadLauncher::createWebThread()
diff --git a/Source/WebKit2/UIProcess/Launcher/qt/ThreadLauncherQt.cpp b/Source/WebKit2/UIProcess/Launcher/qt/ThreadLauncherQt.cpp
index 1d0caf3ae..37d045f93 100644
--- a/Source/WebKit2/UIProcess/Launcher/qt/ThreadLauncherQt.cpp
+++ b/Source/WebKit2/UIProcess/Launcher/qt/ThreadLauncherQt.cpp
@@ -47,7 +47,7 @@ using namespace WebCore;
namespace WebKit {
-static void* webThreadBody(void* /* context */)
+static void webThreadBody(void* /* context */)
{
// Initialization
JSC::initializeThreading();
@@ -57,8 +57,6 @@ static void* webThreadBody(void* /* context */)
WebProcess::shared().initialize(-1, RunLoop::current());
RunLoop::run();
-
- return 0;
}
CoreIPC::Connection::Identifier ThreadLauncher::createWebThread()
diff --git a/Source/WebKit2/UIProcess/Launcher/win/ThreadLauncherWin.cpp b/Source/WebKit2/UIProcess/Launcher/win/ThreadLauncherWin.cpp
index f9d1c0481..5abec7aaa 100644
--- a/Source/WebKit2/UIProcess/Launcher/win/ThreadLauncherWin.cpp
+++ b/Source/WebKit2/UIProcess/Launcher/win/ThreadLauncherWin.cpp
@@ -36,7 +36,7 @@ using namespace WebCore;
namespace WebKit {
-static void* webThreadBody(void* context)
+static void webThreadBody(void* context)
{
HANDLE clientIdentifier = reinterpret_cast<HANDLE>(context);
@@ -46,8 +46,6 @@ static void* webThreadBody(void* context)
WebProcess::shared().initialize(clientIdentifier, RunLoop::current());
RunLoop::run();
-
- return 0;
}
CoreIPC::Connection::Identifier ThreadLauncher::createWebThread()
diff --git a/Source/WebKit2/UIProcess/LayerTreeHostProxy.h b/Source/WebKit2/UIProcess/LayerTreeHostProxy.h
index 4c971875c..504c4e19e 100644
--- a/Source/WebKit2/UIProcess/LayerTreeHostProxy.h
+++ b/Source/WebKit2/UIProcess/LayerTreeHostProxy.h
@@ -30,15 +30,17 @@
#include <WebCore/IntRect.h>
#include <WebCore/IntSize.h>
#include <WebCore/RunLoop.h>
+#include <WebCore/Timer.h>
#include <wtf/HashSet.h>
#if USE(TEXTURE_MAPPER)
#include "TextureMapper.h"
-#include "TextureMapperNode.h"
+#include "TextureMapperBackingStore.h"
#endif
namespace WebKit {
+class LayerBackingStore;
class WebLayerInfo;
class WebLayerUpdateInfo;
@@ -55,8 +57,8 @@ public:
void paintToCurrentGLContext(const WebCore::TransformationMatrix&, float, const WebCore::FloatRect&);
void paintToGraphicsContext(BackingStore::PlatformGraphicsContext);
void purgeGLResources();
- void setVisibleContentsRectAndScale(const WebCore::IntRect&, float);
- void setVisibleContentRectTrajectoryVector(const WebCore::FloatPoint&);
+ void setVisibleContentsRectForScaling(const WebCore::IntRect&, float);
+ void setVisibleContentsRectForPanning(const WebCore::IntRect&, const WebCore::FloatPoint&);
#if USE(TILED_BACKING_STORE)
void syncRemoteContent();
void swapContentBuffers();
@@ -83,7 +85,6 @@ protected:
virtual bool showRepaintCounter(const WebCore::GraphicsLayer*) const { return false; }
void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect&) { }
- WebCore::RunLoop::Timer<LayerTreeHostProxy> m_animationTimer;
DrawingAreaProxy* m_drawingAreaProxy;
typedef HashMap<WebLayerID, WebCore::GraphicsLayer*> LayerMap;
@@ -98,12 +99,6 @@ protected:
#endif
#if PLATFORM(QT)
- typedef HashMap<WebCore::IntPoint, RefPtr<WebCore::BitmapTexture> > TiledImage;
- WebCore::TextureMapperNode::NodeRectMap m_nodeVisualContentsRectMap;
- HashMap<int, int> m_tileToNodeTile;
- int remoteTileIDToNodeTileID(int tileID) const;
- HashMap<int64_t, TiledImage> m_directlyCompositedImages;
-
void scheduleWebViewUpdate();
void synchronizeViewport();
void deleteLayer(WebLayerID);
@@ -118,16 +113,15 @@ protected:
void flushLayerChanges();
void ensureRootLayer();
void ensureLayer(WebLayerID);
-
+ PassRefPtr<LayerBackingStore> getBackingStore(WebLayerID);
+ void swapBuffers();
+ void syncAnimations();
#endif
OwnPtr<WebCore::GraphicsLayer> m_rootLayer;
Vector<WebLayerID> m_layersToDelete;
-
-#if PLATFORM(QT)
- void didFireViewportUpdateTimer(WebCore::Timer<LayerTreeHostProxy>*);
- WebCore::Timer<LayerTreeHostProxy> m_viewportUpdateTimer;
-#endif
+ HashMap<int64_t, RefPtr<WebCore::TextureMapperBackingStore> > m_directlyCompositedImages;
+ HashSet<RefPtr<LayerBackingStore> > m_backingStoresWithPendingBuffers;
LayerMap m_layers;
WebLayerID m_rootLayerID;
diff --git a/Source/WebKit2/UIProcess/PageClient.h b/Source/WebKit2/UIProcess/PageClient.h
index bd6096c93..70ddf07fa 100644
--- a/Source/WebKit2/UIProcess/PageClient.h
+++ b/Source/WebKit2/UIProcess/PageClient.h
@@ -111,6 +111,7 @@ public:
virtual void updateTextInputState() = 0;
virtual void handleAuthenticationRequiredRequest(const String& hostname, const String& realm, const String& prefilledUsername, String& username, String& password) = 0;
virtual void handleCertificateVerificationRequest(const String& hostname, bool& ignoreErrors) = 0;
+ virtual void handleProxyAuthenticationRequiredRequest(const String& hostname, uint16_t port, const String& prefilledUsername, String& username, String& password) = 0;
#endif // PLATFORM(QT).
#if PLATFORM(QT) || PLATFORM(GTK)
diff --git a/Source/WebKit2/UIProcess/WebInspectorProxy.cpp b/Source/WebKit2/UIProcess/WebInspectorProxy.cpp
index cb5df7906..6da04a9cb 100644
--- a/Source/WebKit2/UIProcess/WebInspectorProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebInspectorProxy.cpp
@@ -29,6 +29,7 @@
#if ENABLE(INSPECTOR)
+#include "WebFrameProxy.h"
#include "WebInspectorMessages.h"
#include "WebPageCreationParameters.h"
#include "WebPageGroup.h"
@@ -54,7 +55,7 @@ static PassRefPtr<WebPageGroup> createInspectorPageGroup()
#endif
pageGroup->preferences()->setApplicationChromeModeEnabled(true);
- pageGroup->preferences()->setSuppressIncrementalRendering(true);
+ pageGroup->preferences()->setSuppressesIncrementalRendering(true);
return pageGroup.release();
}
@@ -123,6 +124,22 @@ void WebInspectorProxy::showConsole()
m_page->process()->send(Messages::WebInspector::ShowConsole(), m_page->pageID());
}
+void WebInspectorProxy::showResources()
+{
+ if (!m_page)
+ return;
+
+ m_page->process()->send(Messages::WebInspector::ShowResources(), m_page->pageID());
+}
+
+void WebInspectorProxy::showMainResourceForFrame(WebFrameProxy* frame)
+{
+ if (!m_page)
+ return;
+
+ m_page->process()->send(Messages::WebInspector::ShowMainResourceForFrame(frame->frameID()), m_page->pageID());
+}
+
void WebInspectorProxy::attach()
{
if (!canAttach())
@@ -260,8 +277,17 @@ void WebInspectorProxy::inspectedURLChanged(const String& urlString)
bool WebInspectorProxy::canAttach()
{
- unsigned inspectedWindowHeight = platformInspectedWindowHeight();
- return inspectedWindowHeight && minimumAttachedHeight <= (inspectedWindowHeight * 3 / 4);
+ // Keep this in sync with InspectorFrontendClientLocal::canAttachWindow. There are two implementations
+ // to make life easier in the multi-process world we have. WebInspectorProxy uses canAttach to decide if
+ // we can attach on open (on the UI process side). And InspectorFrontendClientLocal::canAttachWindow is
+ // used to decide if we can attach when the attach button is pressed (on the WebProcess side).
+
+ // Don't allow the attach if the window would be too small to accommodate the minimum inspector height.
+ // Also don't allow attaching to another inspector -- two inspectors in one window is too much!
+ bool isInspectorPage = m_page->pageGroup() == inspectorPageGroup();
+ unsigned inspectedPageHeight = platformInspectedWindowHeight();
+ unsigned maximumAttachedHeight = inspectedPageHeight * 3 / 4;
+ return minimumAttachedHeight <= maximumAttachedHeight && !isInspectorPage;
}
bool WebInspectorProxy::shouldOpenAttached()
diff --git a/Source/WebKit2/UIProcess/WebInspectorProxy.h b/Source/WebKit2/UIProcess/WebInspectorProxy.h
index 56df78cd2..aebb6f9b9 100644
--- a/Source/WebKit2/UIProcess/WebInspectorProxy.h
+++ b/Source/WebKit2/UIProcess/WebInspectorProxy.h
@@ -50,6 +50,7 @@ OBJC_CLASS WKWebInspectorWKView;
namespace WebKit {
+class WebFrameProxy;
class WebPageGroup;
class WebPageProxy;
struct WebPageCreationParameters;
@@ -91,6 +92,8 @@ public:
#endif
void showConsole();
+ void showResources();
+ void showMainResourceForFrame(WebFrameProxy*);
bool isAttached() const { return m_isAttached; }
void attach();
@@ -164,6 +167,8 @@ private:
static const unsigned initialWindowWidth = 750;
static const unsigned initialWindowHeight = 650;
+
+ // Keep this in sync with the value in InspectorFrontendClientLocal.
static const unsigned minimumAttachedHeight = 250;
WebPageProxy* m_page;
diff --git a/Source/WebKit2/UIProcess/WebLoaderClient.cpp b/Source/WebKit2/UIProcess/WebLoaderClient.cpp
index 87feea062..2aae01617 100644
--- a/Source/WebKit2/UIProcess/WebLoaderClient.cpp
+++ b/Source/WebKit2/UIProcess/WebLoaderClient.cpp
@@ -241,12 +241,21 @@ void WebLoaderClient::didChangeBackForwardList(WebPageProxy* page, WebBackForwar
bool WebLoaderClient::shouldGoToBackForwardListItem(WebPageProxy* page, WebBackForwardListItem* item)
{
- if (!m_client.shouldGoToBackForwardListItem)
+ // We should only even considering sending the shouldGoToBackForwardListItem() client callback
+ // for version 0 clients. Later versioned clients should get willGoToBackForwardListItem() instead,
+ // but do to XPC race conditions this one might have been called instead.
+ if (m_client.version > 0 || !m_client.shouldGoToBackForwardListItem)
return true;
-
+
return m_client.shouldGoToBackForwardListItem(toAPI(page), toAPI(item), m_client.clientInfo);
}
+void WebLoaderClient::willGoToBackForwardListItem(WebPageProxy* page, WebBackForwardListItem* item)
+{
+ if (m_client.willGoToBackForwardListItem)
+ m_client.willGoToBackForwardListItem(toAPI(page), toAPI(item), m_client.clientInfo);
+}
+
void WebLoaderClient::didFailToInitializePlugin(WebPageProxy* page, const String& mimeType)
{
if (!m_client.didFailToInitializePlugin)
diff --git a/Source/WebKit2/UIProcess/WebLoaderClient.h b/Source/WebKit2/UIProcess/WebLoaderClient.h
index 970591937..55cc6aace 100644
--- a/Source/WebKit2/UIProcess/WebLoaderClient.h
+++ b/Source/WebKit2/UIProcess/WebLoaderClient.h
@@ -83,6 +83,7 @@ public:
void didChangeBackForwardList(WebPageProxy*, WebBackForwardListItem* addedItem, Vector<RefPtr<APIObject> >* removedItems);
bool shouldGoToBackForwardListItem(WebPageProxy*, WebBackForwardListItem*);
+ void willGoToBackForwardListItem(WebPageProxy*, WebBackForwardListItem*);
void didFailToInitializePlugin(WebPageProxy*, const String& mimeType);
};
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.cpp b/Source/WebKit2/UIProcess/WebPageProxy.cpp
index 85b7d54ca..8ea3fe4a1 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebPageProxy.cpp
@@ -254,6 +254,11 @@ bool WebPageProxy::isValid()
void WebPageProxy::initializeLoaderClient(const WKPageLoaderClient* loadClient)
{
m_loaderClient.initialize(loadClient);
+
+ if (!loadClient)
+ return;
+
+ process()->send(Messages::WebPage::SetWillGoToBackForwardItemCallbackEnabled(loadClient->version > 0), m_pageID);
}
void WebPageProxy::initializePolicyClient(const WKPagePolicyClient* policyClient)
@@ -317,11 +322,7 @@ void WebPageProxy::reattachToWebProcessWithItem(WebBackForwardListItem* item)
if (!item)
return;
- SandboxExtension::Handle sandboxExtensionHandle;
- bool createdExtension = maybeInitializeSandboxExtensionHandle(KURL(KURL(), item->url()), sandboxExtensionHandle);
- if (createdExtension)
- process()->willAcquireUniversalFileReadSandboxExtension();
- process()->send(Messages::WebPage::GoToBackForwardItem(item->itemID(), sandboxExtensionHandle), m_pageID);
+ process()->send(Messages::WebPage::GoToBackForwardItem(item->itemID()), m_pageID);
process()->responsivenessTimer()->start();
}
@@ -509,15 +510,24 @@ void WebPageProxy::stopLoading()
void WebPageProxy::reload(bool reloadFromOrigin)
{
- if (m_backForwardList->currentItem())
- setPendingAPIRequestURL(m_backForwardList->currentItem()->url());
+ SandboxExtension::Handle sandboxExtensionHandle;
+
+ if (m_backForwardList->currentItem()) {
+ String url = m_backForwardList->currentItem()->url();
+ setPendingAPIRequestURL(url);
+
+ // We may not have an extension yet if back/forward list was reinstated after a WebProcess crash or a browser relaunch
+ bool createdExtension = maybeInitializeSandboxExtensionHandle(KURL(KURL(), url), sandboxExtensionHandle);
+ if (createdExtension)
+ process()->willAcquireUniversalFileReadSandboxExtension();
+ }
if (!isValid()) {
reattachToWebProcessWithItem(m_backForwardList->currentItem());
return;
}
- process()->send(Messages::WebPage::Reload(reloadFromOrigin), m_pageID);
+ process()->send(Messages::WebPage::Reload(reloadFromOrigin, sandboxExtensionHandle), m_pageID);
process()->responsivenessTimer()->start();
}
@@ -527,19 +537,17 @@ void WebPageProxy::goForward()
return;
WebBackForwardListItem* forwardItem = m_backForwardList->forwardItem();
- if (forwardItem)
- setPendingAPIRequestURL(forwardItem->url());
+ if (!forwardItem)
+ return;
+
+ setPendingAPIRequestURL(forwardItem->url());
if (!isValid()) {
reattachToWebProcessWithItem(forwardItem);
return;
}
- SandboxExtension::Handle sandboxExtensionHandle;
- bool createdExtension = maybeInitializeSandboxExtensionHandle(KURL(KURL(), forwardItem->url()), sandboxExtensionHandle);
- if (createdExtension)
- process()->willAcquireUniversalFileReadSandboxExtension();
- process()->send(Messages::WebPage::GoForward(forwardItem->itemID(), sandboxExtensionHandle), m_pageID);
+ process()->send(Messages::WebPage::GoForward(forwardItem->itemID()), m_pageID);
process()->responsivenessTimer()->start();
}
@@ -554,19 +562,17 @@ void WebPageProxy::goBack()
return;
WebBackForwardListItem* backItem = m_backForwardList->backItem();
- if (backItem)
- setPendingAPIRequestURL(backItem->url());
+ if (!backItem)
+ return;
+
+ setPendingAPIRequestURL(backItem->url());
if (!isValid()) {
reattachToWebProcessWithItem(backItem);
return;
}
- SandboxExtension::Handle sandboxExtensionHandle;
- bool createdExtension = maybeInitializeSandboxExtensionHandle(KURL(KURL(), backItem->url()), sandboxExtensionHandle);
- if (createdExtension)
- process()->willAcquireUniversalFileReadSandboxExtension();
- process()->send(Messages::WebPage::GoBack(backItem->itemID(), sandboxExtensionHandle), m_pageID);
+ process()->send(Messages::WebPage::GoBack(backItem->itemID()), m_pageID);
process()->responsivenessTimer()->start();
}
@@ -584,11 +590,7 @@ void WebPageProxy::goToBackForwardItem(WebBackForwardListItem* item)
setPendingAPIRequestURL(item->url());
- SandboxExtension::Handle sandboxExtensionHandle;
- bool createdExtension = maybeInitializeSandboxExtensionHandle(KURL(KURL(), item->url()), sandboxExtensionHandle);
- if (createdExtension)
- process()->willAcquireUniversalFileReadSandboxExtension();
- process()->send(Messages::WebPage::GoToBackForwardItem(item->itemID(), sandboxExtensionHandle), m_pageID);
+ process()->send(Messages::WebPage::GoToBackForwardItem(item->itemID()), m_pageID);
process()->responsivenessTimer()->start();
}
@@ -611,6 +613,12 @@ void WebPageProxy::shouldGoToBackForwardListItem(uint64_t itemID, bool& shouldGo
shouldGoToBackForwardItem = item && m_loaderClient.shouldGoToBackForwardListItem(this, item);
}
+void WebPageProxy::willGoToBackForwardListItem(uint64_t itemID)
+{
+ if (WebBackForwardListItem* item = process()->webBackForwardItem(itemID))
+ m_loaderClient.willGoToBackForwardListItem(this, item);
+}
+
String WebPageProxy::activeURL() const
{
if (!m_mainFrame)
@@ -944,7 +952,7 @@ void WebPageProxy::handleWheelEvent(const NativeWebWheelEvent& event)
process()->sendSync(Messages::WebPage::WheelEventSyncForTesting(event), Messages::WebPage::WheelEventSyncForTesting::Reply(handled), m_pageID);
didReceiveEvent(event.type(), handled);
} else
- process()->send(Messages::EventDispatcher::WheelEvent(m_pageID, event), 0);
+ process()->send(Messages::EventDispatcher::WheelEvent(m_pageID, event, canGoBack(), canGoForward()), 0);
}
void WebPageProxy::handleKeyboardEvent(const NativeWebKeyboardEvent& event)
@@ -2399,6 +2407,11 @@ void WebPageProxy::authenticationRequiredRequest(const String& hostname, const S
m_pageClient->handleAuthenticationRequiredRequest(hostname, realm, prefilledUsername, username, password);
}
+void WebPageProxy::proxyAuthenticationRequiredRequest(const String& hostname, uint16_t port, const String& prefilledUsername, String& username, String& password)
+{
+ m_pageClient->handleProxyAuthenticationRequiredRequest(hostname, port, prefilledUsername, username, password);
+}
+
void WebPageProxy::certificateVerificationRequest(const String& hostname, bool& ignoreErrors)
{
m_pageClient->handleCertificateVerificationRequest(hostname, ignoreErrors);
@@ -2448,9 +2461,16 @@ void WebPageProxy::backForwardAddItem(uint64_t itemID)
m_backForwardList->addItem(process()->webBackForwardItem(itemID));
}
-void WebPageProxy::backForwardGoToItem(uint64_t itemID)
+void WebPageProxy::backForwardGoToItem(uint64_t itemID, SandboxExtension::Handle& sandboxExtensionHandle)
{
- m_backForwardList->goToItem(process()->webBackForwardItem(itemID));
+ WebBackForwardListItem* item = process()->webBackForwardItem(itemID);
+ if (!item)
+ return;
+
+ bool createdExtension = maybeInitializeSandboxExtensionHandle(KURL(KURL(), item->url()), sandboxExtensionHandle);
+ if (createdExtension)
+ process()->willAcquireUniversalFileReadSandboxExtension();
+ m_backForwardList->goToItem(item);
}
void WebPageProxy::backForwardItemAtIndex(int32_t index, uint64_t& itemID)
@@ -2992,7 +3012,7 @@ void WebPageProxy::didReceiveEvent(uint32_t opaqueType, bool handled)
WebWheelEvent newWheelEvent = coalescedWheelEvent(m_wheelEventQueue, m_currentlyProcessedWheelEvents);
process()->responsivenessTimer()->start();
- process()->send(Messages::EventDispatcher::WheelEvent(m_pageID, newWheelEvent), 0);
+ process()->send(Messages::EventDispatcher::WheelEvent(m_pageID, newWheelEvent, canGoBack(), canGoForward()), 0);
}
break;
@@ -3302,7 +3322,6 @@ WebPageCreationParameters WebPageProxy::creationParameters() const
#if PLATFORM(WIN)
parameters.nativeWindow = m_pageClient->nativeWindow();
#endif
-
return parameters;
}
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.h b/Source/WebKit2/UIProcess/WebPageProxy.h
index 2e64d16ec..af8da1bef 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.h
+++ b/Source/WebKit2/UIProcess/WebPageProxy.h
@@ -266,6 +266,7 @@ public:
void tryRestoreScrollPosition();
void didChangeBackForwardList(WebBackForwardListItem* addedItem, Vector<RefPtr<APIObject> >* removedItems);
void shouldGoToBackForwardListItem(uint64_t itemID, bool& shouldGoToBackForwardListItem);
+ void willGoToBackForwardListItem(uint64_t itemID);
String activeURL() const;
String provisionalURL() const;
@@ -322,6 +323,7 @@ public:
void sendApplicationSchemeReply(const QQuickNetworkReply*);
void authenticationRequiredRequest(const String& hostname, const String& realm, const String& prefilledUsername, String& username, String& password);
void certificateVerificationRequest(const String& hostname, bool& ignoreErrors);
+ void proxyAuthenticationRequiredRequest(const String& hostname, uint16_t port, const String& prefilledUsername, String& username, String& password);
#endif // PLATFORM(QT).
#if PLATFORM(QT)
@@ -743,7 +745,7 @@ private:
// Back/Forward list management
void backForwardAddItem(uint64_t itemID);
- void backForwardGoToItem(uint64_t itemID);
+ void backForwardGoToItem(uint64_t itemID, SandboxExtension::Handle&);
void backForwardItemAtIndex(int32_t index, uint64_t& itemID);
void backForwardBackListCount(int32_t& count);
void backForwardForwardListCount(int32_t& count);
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.messages.in b/Source/WebKit2/UIProcess/WebPageProxy.messages.in
index 9ba1d5254..cb0c629e6 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.messages.in
+++ b/Source/WebKit2/UIProcess/WebPageProxy.messages.in
@@ -76,6 +76,7 @@ messages -> WebPageProxy {
DidFindZoomableArea(WebCore::IntPoint target, WebCore::IntRect area)
AuthenticationRequiredRequest(WTF::String hostname, WTF::String realm, WTF::String prefilledUsername) -> (WTF::String username, WTF::String password)
CertificateVerificationRequest(WTF::String hostname) -> (bool ignoreErrors)
+ ProxyAuthenticationRequiredRequest(WTF::String hostname, uint16_t port, WTF::String prefilledUsername) -> (WTF::String username, WTF::String password)
#endif
#if ENABLE(TOUCH_EVENTS)
NeedTouchEvents(bool needTouchEvents)
@@ -156,12 +157,13 @@ messages -> WebPageProxy {
# BackForward messages
BackForwardAddItem(uint64_t itemID)
- BackForwardGoToItem(uint64_t itemID)
+ BackForwardGoToItem(uint64_t itemID) -> (WebKit::SandboxExtension::Handle sandboxExtensionHandle)
BackForwardItemAtIndex(int32_t itemIndex) -> (uint64_t itemID)
BackForwardBackListCount() -> (int32_t count)
BackForwardForwardListCount() -> (int32_t count)
BackForwardClear()
ShouldGoToBackForwardListItem(uint64_t itemID) -> (bool shouldGoToBackForwardListItem)
+ WillGoToBackForwardListItem(uint64_t itemID)
# Undo/Redo messages
RegisterEditCommandForUndo(uint64_t commandID, uint32_t editAction)
diff --git a/Source/WebKit2/UIProcess/WebProcessProxy.cpp b/Source/WebKit2/UIProcess/WebProcessProxy.cpp
index 2109d9e7a..9ce54407e 100644
--- a/Source/WebKit2/UIProcess/WebProcessProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebProcessProxy.cpp
@@ -245,7 +245,17 @@ bool WebProcessProxy::checkURLReceivedFromWebProcess(const KURL& url)
return true;
}
+ // Items in back/forward list have been already checked.
+ // One case where we don't have sandbox extensions for file URLs in b/f list is if the list has been reinstated after a crash or a browser restart.
+ for (WebBackForwardListItemMap::iterator iter = m_backForwardListItemMap.begin(), end = m_backForwardListItemMap.end(); iter != end; ++iter) {
+ if (KURL(KURL(), iter->second->url()).fileSystemPath() == path)
+ return true;
+ if (KURL(KURL(), iter->second->originalURL()).fileSystemPath() == path)
+ return true;
+ }
+
// A Web process that was never asked to load a file URL should not ever ask us to do anything with a file URL.
+ fprintf(stderr, "Received an unexpected URL from the web process: '%s'\n", url.string().utf8().data());
return false;
}
@@ -368,9 +378,7 @@ void WebProcessProxy::didClose(CoreIPC::Connection*)
void WebProcessProxy::didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID messageID)
{
- // This fprintf is intentionally left because this function should
- // only be hit in the case of a misbehaving web process.
- fprintf(stderr, "Receive an invalid message from the web process with message ID %x\n", messageID.toInt());
+ fprintf(stderr, "Received an invalid message from the web process with message ID %x\n", messageID.toInt());
// Terminate the WebProcesses.
terminate();
diff --git a/Source/WebKit2/UIProcess/cf/WebPageProxyCF.cpp b/Source/WebKit2/UIProcess/cf/WebPageProxyCF.cpp
index 0524bc517..79dd8ced0 100644
--- a/Source/WebKit2/UIProcess/cf/WebPageProxyCF.cpp
+++ b/Source/WebKit2/UIProcess/cf/WebPageProxyCF.cpp
@@ -164,15 +164,10 @@ void WebPageProxy::restoreFromSessionStateData(WebData* webData)
if (provisionalURL)
process()->send(Messages::WebPage::RestoreSession(state), m_pageID);
else {
- SandboxExtension::Handle sandboxExtensionHandle;
- if (WebBackForwardListItem* item = m_backForwardList->currentItem()) {
- bool createdExtension = maybeInitializeSandboxExtensionHandle(KURL(KURL(), item->url()), sandboxExtensionHandle);
- if (createdExtension)
- process()->willAcquireUniversalFileReadSandboxExtension();
+ if (WebBackForwardListItem* item = m_backForwardList->currentItem())
setPendingAPIRequestURL(item->url());
- }
- process()->send(Messages::WebPage::RestoreSessionAndNavigateToCurrentItem(state, sandboxExtensionHandle), m_pageID);
+ process()->send(Messages::WebPage::RestoreSessionAndNavigateToCurrentItem(state), m_pageID);
}
}
}
diff --git a/Source/WebKit2/UIProcess/mac/BackingStoreMac.mm b/Source/WebKit2/UIProcess/mac/BackingStoreMac.mm
index 646962f7e..2d159137e 100644
--- a/Source/WebKit2/UIProcess/mac/BackingStoreMac.mm
+++ b/Source/WebKit2/UIProcess/mac/BackingStoreMac.mm
@@ -31,26 +31,109 @@
#import "UpdateInfo.h"
#import "WebPageProxy.h"
#import <WebCore/GraphicsContext.h>
+#import <WebCore/Region.h>
using namespace WebCore;
namespace WebKit {
-void BackingStore::paint(PlatformGraphicsContext context, const IntRect& rect)
+void BackingStore::performWithScrolledRectTransform(const IntRect& rect, void (^block)(const IntRect&, const IntSize&))
{
- if (m_cgLayer) {
- CGContextSaveGState(context);
- CGContextClipToRect(context, rect);
+ if (m_scrolledRect.isEmpty() || m_scrolledRectOffset.isZero() || !m_scrolledRect.intersects(rect)) {
+ block(rect, IntSize());
+ return;
+ }
- CGContextScaleCTM(context, 1, -1);
- CGContextDrawLayerAtPoint(context, CGPointMake(0, -m_size.height()), m_cgLayer.get());
+ // The part of rect that's outside the scrolled rect is not translated.
+ Region untranslatedRegion = rect;
+ untranslatedRegion.subtract(m_scrolledRect);
+ Vector<IntRect> untranslatedRects = untranslatedRegion.rects();
+ for (size_t i = 0; i < untranslatedRects.size(); ++i)
+ block(untranslatedRects[i], IntSize());
+
+ // The part of rect that intersects the scrolled rect comprises up to four parts, each subject
+ // to a different translation (all translations are equivalent modulo the dimensions of the
+ // scrolled rect to the scroll offset).
+ IntRect intersection = rect;
+ intersection.intersect(m_scrolledRect);
+
+ IntRect scrolledRect = m_scrolledRect;
+ IntSize offset = m_scrolledRectOffset;
+ scrolledRect.move(-offset);
+
+ IntRect part = intersection;
+ part.intersect(scrolledRect);
+ if (!part.isEmpty())
+ block(part, offset);
+
+ part = intersection;
+ offset += IntSize(0, -m_scrolledRect.height());
+ scrolledRect.move(IntSize(0, m_scrolledRect.height()));
+ part.intersect(scrolledRect);
+ if (!part.isEmpty())
+ block(part, offset);
+
+ part = intersection;
+ offset += IntSize(-m_scrolledRect.width(), 0);
+ scrolledRect.move(IntSize(m_scrolledRect.width(), 0));
+ part.intersect(scrolledRect);
+ if (!part.isEmpty())
+ block(part, offset);
+
+ part = intersection;
+ offset += IntSize(0, m_scrolledRect.height());
+ scrolledRect.move(IntSize(0, -m_scrolledRect.height()));
+ part.intersect(scrolledRect);
+ if (!part.isEmpty())
+ block(part, offset);
+}
+
+void BackingStore::resetScrolledRect()
+{
+ ASSERT(!m_scrolledRect.isEmpty());
- CGContextRestoreGState(context);
+ if (m_scrolledRectOffset.isZero()) {
+ m_scrolledRect = IntRect();
return;
}
- ASSERT(m_bitmapContext);
- paintBitmapContext(context, m_bitmapContext.get(), rect.location(), rect);
+ RetainPtr<CGColorSpaceRef> colorSpace(AdoptCF, CGColorSpaceCreateDeviceRGB());
+ RetainPtr<CGContextRef> context(AdoptCF, CGBitmapContextCreate(0, m_scrolledRect.size().width(), m_scrolledRect.size().height(), 8, m_scrolledRect.size().width() * 4, colorSpace.get(), kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host));
+
+ CGContextTranslateCTM(context.get(), -m_scrolledRect.location().x(), -m_scrolledRect.location().y());
+ CGContextTranslateCTM(context.get(), 0, m_scrolledRect.size().height());
+ CGContextScaleCTM(context.get(), 1, -1);
+ paint(context.get(), m_scrolledRect);
+
+ IntRect sourceRect(IntPoint(), m_scrolledRect.size());
+ paintBitmapContext(backingStoreContext(), context.get(), m_scrolledRect.location(), sourceRect);
+
+ m_scrolledRect = IntRect();
+ m_scrolledRectOffset = IntSize();
+}
+
+void BackingStore::paint(PlatformGraphicsContext context, const IntRect& rect)
+{
+ // FIXME: This is defined outside the block to work around bugs in llvm-gcc 4.2.
+ __block CGRect source;
+ performWithScrolledRectTransform(rect, ^(const IntRect& part, const IntSize& offset) {
+ if (m_cgLayer) {
+ CGContextSaveGState(context);
+ CGContextClipToRect(context, part);
+
+ CGContextScaleCTM(context, 1, -1);
+ CGContextDrawLayerAtPoint(context, CGPointMake(-offset.width(), offset.height() - m_size.height()), m_cgLayer.get());
+
+ CGContextRestoreGState(context);
+ return;
+ }
+
+ ASSERT(m_bitmapContext);
+ source = part;
+ source.origin.x += offset.width();
+ source.origin.y += offset.height();
+ paintBitmapContext(context, m_bitmapContext.get(), part.location(), source);
+ });
}
CGContextRef BackingStore::backingStoreContext()
@@ -101,15 +184,20 @@ void BackingStore::incorporateUpdate(ShareableBitmap* bitmap, const UpdateInfo&
IntPoint updateRectLocation = updateInfo.updateRectBounds.location();
- GraphicsContext graphicsContext(context);
+ GraphicsContext ctx(context);
+ __block GraphicsContext* graphicsContext = &ctx;
// Paint all update rects.
for (size_t i = 0; i < updateInfo.updateRects.size(); ++i) {
IntRect updateRect = updateInfo.updateRects[i];
IntRect srcRect = updateRect;
- srcRect.move(-updateRectLocation.x(), -updateRectLocation.y());
-
- bitmap->paint(graphicsContext, updateInfo.deviceScaleFactor, updateRect.location(), srcRect);
+ // FIXME: This is defined outside the block to work around bugs in llvm-gcc 4.2.
+ __block IntRect srcPart;
+ performWithScrolledRectTransform(srcRect, ^(const IntRect& part, const IntSize& offset) {
+ srcPart = part;
+ srcPart.move(-updateRectLocation.x(), -updateRectLocation.y());
+ bitmap->paint(*graphicsContext, updateInfo.deviceScaleFactor, part.location() + offset, srcPart);
+ });
}
}
@@ -118,26 +206,20 @@ void BackingStore::scroll(const IntRect& scrollRect, const IntSize& scrollOffset
if (scrollOffset.isZero())
return;
- if (m_cgLayer) {
- CGContextRef layerContext = CGLayerGetContext(m_cgLayer.get());
-
- // Scroll the layer by painting it into itself with the given offset.
- CGContextSaveGState(layerContext);
- CGContextClipToRect(layerContext, scrollRect);
- CGContextScaleCTM(layerContext, 1, -1);
- CGContextDrawLayerAtPoint(layerContext, CGPointMake(scrollOffset.width(), -m_size.height() - scrollOffset.height()), m_cgLayer.get());
- CGContextRestoreGState(layerContext);
+ if (!m_scrolledRect.isEmpty() && m_scrolledRect != scrollRect)
+ resetScrolledRect();
- return;
- }
+ m_scrolledRect = scrollRect;
- ASSERT(m_bitmapContext);
+ int width = (m_scrolledRectOffset.width() - scrollOffset.width()) % m_scrolledRect.width();
+ if (width < 0)
+ width += m_scrolledRect.width();
+ m_scrolledRectOffset.setWidth(width);
- CGContextSaveGState(m_bitmapContext.get());
- CGContextClipToRect(m_bitmapContext.get(), scrollRect);
- CGPoint destination = CGPointMake(scrollRect.x() + scrollOffset.width(), scrollRect.y() + scrollOffset.height());
- paintBitmapContext(m_bitmapContext.get(), m_bitmapContext.get(), destination, scrollRect);
- CGContextRestoreGState(m_bitmapContext.get());
+ int height = (m_scrolledRectOffset.height() - scrollOffset.height()) % m_scrolledRect.height();
+ if (height < 0)
+ height += m_scrolledRect.height();
+ m_scrolledRectOffset.setHeight(height);
}
} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm b/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm
index 25d4e44a1..319bcb401 100644
--- a/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm
+++ b/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm
@@ -53,7 +53,7 @@ TiledCoreAnimationDrawingAreaProxy::~TiledCoreAnimationDrawingAreaProxy()
void TiledCoreAnimationDrawingAreaProxy::deviceScaleFactorDidChange()
{
- // FIXME: Implement.
+ m_webPageProxy->process()->send(Messages::DrawingArea::SetDeviceScaleFactor(m_webPageProxy->deviceScaleFactor()), m_webPageProxy->pageID());
}
void TiledCoreAnimationDrawingAreaProxy::sizeDidChange()
diff --git a/Source/WebKit2/UIProcess/qt/LayerBackingStore.cpp b/Source/WebKit2/UIProcess/qt/LayerBackingStore.cpp
new file mode 100644
index 000000000..c6df57efb
--- /dev/null
+++ b/Source/WebKit2/UIProcess/qt/LayerBackingStore.cpp
@@ -0,0 +1,143 @@
+/*
+ Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "LayerBackingStore.h"
+
+#include "GraphicsLayer.h"
+#include "TextureMapper.h"
+
+#include "stdio.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+void LayerBackingStoreTile::swapBuffers(WebCore::TextureMapper* textureMapper)
+{
+ if (!m_backBuffer)
+ return;
+
+ FloatRect targetRect(m_targetRect);
+ targetRect.scale(1. / m_scale);
+ bool shouldReset = false;
+ if (targetRect != rect()) {
+ setRect(targetRect);
+ shouldReset = true;
+ }
+ RefPtr<BitmapTexture> texture = this->texture();
+ if (!texture) {
+ texture = textureMapper->createTexture();
+ setTexture(texture.get());
+ shouldReset = true;
+ }
+
+ QImage qImage = m_backBuffer->createQImage();
+
+ if (shouldReset)
+ texture->reset(m_sourceRect.size(), qImage.hasAlphaChannel() ? BitmapTexture::SupportsAlpha : 0);
+
+ texture->updateContents(qImage.constBits(), m_sourceRect);
+ m_backBuffer.clear();
+}
+
+void LayerBackingStoreTile::setBackBuffer(const WebCore::IntRect& targetRect, const WebCore::IntRect& sourceRect, ShareableBitmap* buffer)
+{
+ m_sourceRect = sourceRect;
+ m_targetRect = targetRect;
+ m_backBuffer = buffer;
+}
+
+void LayerBackingStore::createTile(int id, float scale)
+{
+ m_tiles.add(id, LayerBackingStoreTile(scale));
+ m_scale = scale;
+}
+
+void LayerBackingStore::removeTile(int id)
+{
+ m_tiles.remove(id);
+}
+
+void LayerBackingStore::updateTile(int id, const IntRect& sourceRect, const IntRect& targetRect, ShareableBitmap* backBuffer)
+{
+ HashMap<int, LayerBackingStoreTile>::iterator it = m_tiles.find(id);
+ ASSERT(it != m_tiles.end());
+ it->second.setBackBuffer(targetRect, sourceRect, backBuffer);
+}
+
+PassRefPtr<BitmapTexture> LayerBackingStore::texture() const
+{
+ HashMap<int, LayerBackingStoreTile>::const_iterator end = m_tiles.end();
+ for (HashMap<int, LayerBackingStoreTile>::const_iterator it = m_tiles.begin(); it != end; ++it) {
+ RefPtr<BitmapTexture> texture = it->second.texture();
+ if (texture)
+ return texture;
+ }
+
+ return PassRefPtr<BitmapTexture>();
+}
+
+void LayerBackingStore::paintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity, BitmapTexture* mask)
+{
+ Vector<TextureMapperTile*> tilesToPaint;
+
+ // We have to do this every time we paint, in case the opacity has changed.
+ HashMap<int, LayerBackingStoreTile>::iterator end = m_tiles.end();
+ FloatRect coveredRect;
+ for (HashMap<int, LayerBackingStoreTile>::iterator it = m_tiles.begin(); it != end; ++it) {
+ LayerBackingStoreTile& tile = it->second;
+ if (!tile.texture())
+ continue;
+
+ if (tile.scale() == m_scale) {
+ tilesToPaint.append(&tile);
+ coveredRect.unite(tile.rect());
+ continue;
+ }
+
+ // Only show the previous tile if the opacity is high, otherwise effect looks like a bug.
+ // We show the previous-scale tile anyway if it doesn't intersect with any current-scale tile.
+ if (opacity < 0.95 && coveredRect.intersects(tile.rect()))
+ continue;
+
+ tilesToPaint.prepend(&tile);
+ coveredRect.unite(tile.rect());
+ }
+
+ bool shouldClip = !targetRect.contains(coveredRect);
+
+ if (shouldClip)
+ textureMapper->beginClip(transform, targetRect);
+
+ for (size_t i = 0; i < tilesToPaint.size(); ++i)
+ tilesToPaint[i]->paint(textureMapper, transform, opacity, mask);
+
+ if (shouldClip)
+ textureMapper->endClip();
+}
+
+void LayerBackingStore::swapBuffers(TextureMapper* textureMapper)
+{
+ HashMap<int, LayerBackingStoreTile>::iterator end = m_tiles.end();
+ for (HashMap<int, LayerBackingStoreTile>::iterator it = m_tiles.begin(); it != end; ++it)
+ it->second.swapBuffers(textureMapper);
+}
+
+}
diff --git a/Source/WebKit2/UIProcess/qt/LayerBackingStore.h b/Source/WebKit2/UIProcess/qt/LayerBackingStore.h
new file mode 100644
index 000000000..e62fcc840
--- /dev/null
+++ b/Source/WebKit2/UIProcess/qt/LayerBackingStore.h
@@ -0,0 +1,68 @@
+/*
+ Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+ */
+
+#ifndef LayerBackingStore_h
+#define LayerBackingStore_h
+
+#include "HashMap.h"
+#include "ShareableBitmap.h"
+#include "TextureMapper.h"
+#include "TextureMapperBackingStore.h"
+
+namespace WebKit {
+
+class LayerBackingStoreTile : public WebCore::TextureMapperTile {
+public:
+ LayerBackingStoreTile(float scale = 1)
+ : TextureMapperTile(WebCore::FloatRect())
+ , m_scale(scale)
+ {
+ }
+
+ inline float scale() const { return m_scale; }
+ void swapBuffers(WebCore::TextureMapper*);
+ void setBackBuffer(const WebCore::IntRect&, const WebCore::IntRect&, ShareableBitmap* buffer);
+
+private:
+ RefPtr<ShareableBitmap> m_backBuffer;
+ WebCore::IntRect m_sourceRect;
+ WebCore::IntRect m_targetRect;
+ float m_scale;
+};
+
+class LayerBackingStore : public WebCore::TextureMapperBackingStore {
+public:
+ void createTile(int, float);
+ void removeTile(int);
+ void updateTile(int, const WebCore::IntRect&, const WebCore::IntRect&, ShareableBitmap*);
+ static PassRefPtr<LayerBackingStore> create() { return adoptRef(new LayerBackingStore); }
+ void swapBuffers(WebCore::TextureMapper*);
+ PassRefPtr<WebCore::BitmapTexture> texture() const;
+ virtual void paintToTextureMapper(WebCore::TextureMapper*, const WebCore::FloatRect&, const WebCore::TransformationMatrix&, float, WebCore::BitmapTexture*);
+
+private:
+ LayerBackingStore()
+ : m_scale(1.)
+ { }
+ HashMap<int, LayerBackingStoreTile> m_tiles;
+ float m_scale;
+};
+
+}
+#endif // LayerBackingStore_h
diff --git a/Source/WebKit2/UIProcess/qt/LayerTreeHostProxyQt.cpp b/Source/WebKit2/UIProcess/qt/LayerTreeHostProxyQt.cpp
index c7ca7f116..ee05eaf41 100644
--- a/Source/WebKit2/UIProcess/qt/LayerTreeHostProxyQt.cpp
+++ b/Source/WebKit2/UIProcess/qt/LayerTreeHostProxyQt.cpp
@@ -22,21 +22,22 @@
#if USE(ACCELERATED_COMPOSITING)
#include "LayerTreeHostProxy.h"
+#include "GraphicsLayerTextureMapper.h"
+#include "LayerBackingStore.h"
#include "LayerTreeHostMessages.h"
#include "MainThread.h"
#include "MessageID.h"
#include "ShareableBitmap.h"
#include "TextureMapper.h"
+#include "TextureMapperBackingStore.h"
+#include "TextureMapperLayer.h"
#include "UpdateInfo.h"
#include "WebCoreArgumentCoders.h"
#include "WebLayerTreeInfo.h"
#include "WebPageProxy.h"
#include "WebProcessProxy.h"
-#include "texmap/GraphicsLayerTextureMapper.h"
-#include "texmap/TextureMapper.h"
-#include "texmap/TextureMapperNode.h"
+#include <OpenGLShims.h>
#include <QDateTime>
-#include <cairo/OpenGLShims.h>
namespace WebKit {
@@ -148,16 +149,13 @@ class SetRootLayerMessage
PassOwnPtr<GraphicsLayer> LayerTreeHostProxy::createLayer(WebLayerID layerID)
{
GraphicsLayer* newLayer = new GraphicsLayerTextureMapper(this);
- TextureMapperNode* node = toTextureMapperNode(newLayer);
- node->setID(layerID);
- node->setTileOwnership(TextureMapperNode::ExternallyManagedTiles);
+ TextureMapperLayer* layer = toTextureMapperLayer(newLayer);
+ layer->setShouldUpdateBackingStoreFromLayer(false);
return adoptPtr(newLayer);
}
LayerTreeHostProxy::LayerTreeHostProxy(DrawingAreaProxy* drawingAreaProxy)
- : m_animationTimer(RunLoop::main(), this, &LayerTreeHostProxy::updateViewport)
- , m_drawingAreaProxy(drawingAreaProxy)
- , m_viewportUpdateTimer(this, &LayerTreeHostProxy::didFireViewportUpdateTimer)
+ : m_drawingAreaProxy(drawingAreaProxy)
, m_rootLayerID(0)
{
}
@@ -178,12 +176,12 @@ void LayerTreeHostProxy::paintToCurrentGLContext(const TransformationMatrix& mat
if (!currentRootLayer)
return;
- TextureMapperNode* node = toTextureMapperNode(currentRootLayer);
+ TextureMapperLayer* layer = toTextureMapperLayer(currentRootLayer);
- if (!node)
+ if (!layer)
return;
- node->setTextureMapper(m_textureMapper.get());
+ layer->setTextureMapper(m_textureMapper.get());
m_textureMapper->beginPainting();
m_textureMapper->bindSurface(0);
m_textureMapper->beginClip(TransformationMatrix(), clipRect);
@@ -194,14 +192,21 @@ void LayerTreeHostProxy::paintToCurrentGLContext(const TransformationMatrix& mat
currentRootLayer->syncCompositingStateForThisLayerOnly();
}
- node->paint();
+ layer->paint();
m_textureMapper->endClip();
m_textureMapper->endPainting();
- if (node->descendantsOrSelfHaveRunningAnimations()) {
- node->syncAnimationsRecursively();
- m_viewportUpdateTimer.startOneShot(0);
- }
+ syncAnimations();
+}
+
+void LayerTreeHostProxy::syncAnimations()
+{
+ TextureMapperLayer* layer = toTextureMapperLayer(rootLayer());
+ ASSERT(layer);
+
+ layer->syncAnimationsRecursively();
+ if (layer->descendantsOrSelfHaveRunningAnimations())
+ updateViewport();
}
void LayerTreeHostProxy::paintToGraphicsContext(QPainter* painter)
@@ -210,46 +215,32 @@ void LayerTreeHostProxy::paintToGraphicsContext(QPainter* painter)
m_textureMapper = TextureMapper::create();
ASSERT(m_textureMapper->accelerationMode() == TextureMapper::SoftwareMode);
syncRemoteContent();
- TextureMapperNode* node = toTextureMapperNode(rootLayer());
+ TextureMapperLayer* layer = toTextureMapperLayer(rootLayer());
- if (!node)
+ if (!layer)
return;
GraphicsContext graphicsContext(painter);
m_textureMapper->setGraphicsContext(&graphicsContext);
m_textureMapper->beginPainting();
m_textureMapper->bindSurface(0);
- node->paint();
+ layer->paint();
m_textureMapper->endPainting();
m_textureMapper->setGraphicsContext(0);
}
-
-void LayerTreeHostProxy::didFireViewportUpdateTimer(Timer<LayerTreeHostProxy>*)
-{
- updateViewport();
-}
-
void LayerTreeHostProxy::updateViewport()
{
m_drawingAreaProxy->updateViewport();
}
-int LayerTreeHostProxy::remoteTileIDToNodeTileID(int tileID) const
-{
- HashMap<int, int>::const_iterator it = m_tileToNodeTile.find(tileID);
- if (it == m_tileToNodeTile.end())
- return 0;
- return it->second;
-}
-
void LayerTreeHostProxy::syncLayerParameters(const WebLayerInfo& layerInfo)
{
WebLayerID id = layerInfo.id;
ensureLayer(id);
LayerMap::iterator it = m_layers.find(id);
GraphicsLayer* layer = it->second;
- bool needsToUpdateImageTiles = layerInfo.imageIsUpdated || layerInfo.contentsRect != layer->contentsRect();
+ bool needsToUpdateImageTiles = layerInfo.imageIsUpdated || (layerInfo.contentsRect != layer->contentsRect() && layerInfo.imageBackingStoreID);
layer->setName(layerInfo.name);
@@ -348,69 +339,41 @@ void LayerTreeHostProxy::setRootLayerID(WebLayerID layerID)
m_rootLayer->addChild(layer);
}
-void LayerTreeHostProxy::createTile(WebLayerID layerID, int tileID, float scale)
+PassRefPtr<LayerBackingStore> LayerTreeHostProxy::getBackingStore(WebLayerID id)
{
- ensureLayer(layerID);
- TextureMapperNode* node = toTextureMapperNode(layerByID(layerID));
+ ensureLayer(id);
+ TextureMapperLayer* layer = toTextureMapperLayer(layerByID(id));
+ RefPtr<LayerBackingStore> backingStore = static_cast<LayerBackingStore*>(layer->backingStore().get());
+ if (!backingStore) {
+ backingStore = LayerBackingStore::create();
+ layer->setBackingStore(backingStore.get());
+ }
+ ASSERT(backingStore);
+ return backingStore;
+}
- int nodeTileID = node->createContentsTile(scale);
- m_tileToNodeTile.add(tileID, nodeTileID);
+void LayerTreeHostProxy::createTile(WebLayerID layerID, int tileID, float scale)
+{
+ getBackingStore(layerID)->createTile(tileID, scale);
}
void LayerTreeHostProxy::removeTile(WebLayerID layerID, int tileID)
{
- TextureMapperNode* node = toTextureMapperNode(layerByID(layerID));
- if (!node)
- return;
-
- int nodeTileID = remoteTileIDToNodeTileID(tileID);
- if (!nodeTileID)
- return;
-
- node->removeContentsTile(nodeTileID);
- m_tileToNodeTile.remove(tileID);
+ getBackingStore(layerID)->removeTile(tileID);
}
void LayerTreeHostProxy::updateTile(WebLayerID layerID, int tileID, const IntRect& sourceRect, const IntRect& targetRect, ShareableBitmap* bitmap)
{
- ensureLayer(layerID);
- TextureMapperNode* node = toTextureMapperNode(layerByID(layerID));
- if (!node)
- return;
-
- int nodeTileID = remoteTileIDToNodeTileID(tileID);
- if (!nodeTileID)
- return;
-
- node->setTextureMapper(m_textureMapper.get());
- QImage image = bitmap->createQImage();
- node->setContentsTileBackBuffer(nodeTileID, sourceRect, targetRect, image.constBits());
+ RefPtr<LayerBackingStore> backingStore = getBackingStore(layerID);
+ backingStore->updateTile(tileID, sourceRect, targetRect, bitmap);
+ m_backingStoresWithPendingBuffers.add(backingStore);
}
void LayerTreeHostProxy::createImage(int64_t imageID, ShareableBitmap* bitmap)
{
- TiledImage tiledImage;
- static const int TileDimension = 1024;
- QImage image = bitmap->createQImage();
- bool imageHasAlpha = image.hasAlphaChannel();
- IntRect imageRect(0, 0, image.width(), image.height());
- for (int y = 0; y < image.height(); y += TileDimension) {
- for (int x = 0; x < image.width(); x += TileDimension) {
- QImage subImage;
- IntRect rect(x, y, TileDimension, TileDimension);
- rect.intersect(imageRect);
- if (QSize(rect.size()) == image.size())
- subImage = image;
- else
- subImage = image.copy(rect);
- RefPtr<BitmapTexture> texture = m_textureMapper->createTexture();
- texture->reset(rect.size(), !imageHasAlpha);
- texture->updateContents(subImage.constBits(), IntRect(IntPoint::zero(), rect.size()));
- tiledImage.add(rect.location(), texture);
- }
- }
-
- m_directlyCompositedImages.set(imageID, tiledImage);
+ RefPtr<TextureMapperTiledBackingStore> backingStore = TextureMapperTiledBackingStore::create();
+ backingStore->updateContents(m_textureMapper.get(), bitmap->createImage().get(), BitmapTexture::BGRAFormat);
+ m_directlyCompositedImages.set(imageID, backingStore);
}
void LayerTreeHostProxy::destroyImage(int64_t imageID)
@@ -420,38 +383,25 @@ void LayerTreeHostProxy::destroyImage(int64_t imageID)
void LayerTreeHostProxy::assignImageToLayer(GraphicsLayer* layer, int64_t imageID)
{
- TextureMapperNode* node = toTextureMapperNode(layer);
- if (!node)
- return;
-
- if (!imageID) {
- node->clearAllDirectlyCompositedImageTiles();
- return;
- }
+ HashMap<int64_t, RefPtr<TextureMapperBackingStore> >::iterator it = m_directlyCompositedImages.find(imageID);
+ ASSERT(it != m_directlyCompositedImages.end());
+ layer->setContentsToMedia(it->second.get());
+}
- FloatSize size(layer->size());
- FloatRect contentsRect(layer->contentsRect());
- float horizontalFactor = contentsRect.width() / size.width();
- float verticalFactor = contentsRect.height() / size.height();
- HashMap<int64_t, TiledImage>::iterator it = m_directlyCompositedImages.find(imageID);
- if (it == m_directlyCompositedImages.end())
- return;
+void LayerTreeHostProxy::swapBuffers()
+{
+ HashSet<RefPtr<LayerBackingStore> >::iterator end = m_backingStoresWithPendingBuffers.end();
+ for (HashSet<RefPtr<LayerBackingStore> >::iterator it = m_backingStoresWithPendingBuffers.begin(); it != end; ++it)
+ (*it)->swapBuffers(m_textureMapper.get());
- TiledImage::iterator endTileIterator = it->second.end();
- for (TiledImage::iterator tileIt = it->second.begin(); tileIt != endTileIterator; ++tileIt) {
- FloatRect sourceRect(FloatPoint(tileIt->first), FloatSize(tileIt->second->size()));
- FloatRect targetRect(sourceRect.x() * horizontalFactor + contentsRect.x(),
- sourceRect.y() * verticalFactor + contentsRect.y(),
- sourceRect.width() * horizontalFactor,
- sourceRect.height() * verticalFactor);
- int newTileID = node->createContentsTile(1.0);
- node->setTileBackBufferTextureForDirectlyCompositedImage(newTileID, IntRect(sourceRect), targetRect, tileIt->second.get());
- }
+ m_backingStoresWithPendingBuffers.clear();
}
void LayerTreeHostProxy::flushLayerChanges()
{
m_rootLayer->syncCompositingState(FloatRect());
+ swapBuffers();
+
// The pending tiles state is on its way for the screen, tell the web process to render the next one.
m_drawingAreaProxy->page()->process()->send(Messages::LayerTreeHost::RenderNextFrame(), m_drawingAreaProxy->page()->pageID());
}
@@ -469,7 +419,7 @@ void LayerTreeHostProxy::ensureRootLayer()
m_rootLayer->setSize(FloatSize(1.0, 1.0));
if (!m_textureMapper)
m_textureMapper = TextureMapper::create(TextureMapper::OpenGLMode);
- toTextureMapperNode(m_rootLayer.get())->setTextureMapper(m_textureMapper.get());
+ toTextureMapperLayer(m_rootLayer.get())->setTextureMapper(m_textureMapper.get());
}
void LayerTreeHostProxy::syncRemoteContent()
@@ -556,7 +506,8 @@ void LayerTreeHostProxy::updateTileForLayer(int layerID, int tileID, const WebKi
data.layerID = layerID;
data.remoteTileID = tileID;
data.bitmap = ShareableBitmap::create(updateInfo.bitmapHandle);
- data.sourceRect = IntRect(IntPoint::zero(), updateInfo.updateRectBounds.size());
+ ASSERT(updateInfo.updateRects.size() == 1);
+ data.sourceRect = updateInfo.updateRects.first();
data.targetRect = updateInfo.updateRectBounds;
pushUpdateToQueue(UpdateTileMessage::create(data));
}
@@ -612,29 +563,28 @@ void LayerTreeHostProxy::destroyDirectlyCompositedImage(int64_t key)
pushUpdateToQueue(DestroyImageMessage::create(data));
}
-void LayerTreeHostProxy::setVisibleContentRectTrajectoryVector(const FloatPoint& trajectoryVector)
+void LayerTreeHostProxy::setVisibleContentsRectForPanning(const IntRect& rect, const FloatPoint& trajectoryVector)
{
- m_drawingAreaProxy->page()->process()->send(Messages::LayerTreeHost::SetVisibleContentRectTrajectoryVector(trajectoryVector), m_drawingAreaProxy->page()->pageID());
+ m_drawingAreaProxy->page()->process()->send(Messages::LayerTreeHost::SetVisibleContentsRectForPanning(rect, trajectoryVector), m_drawingAreaProxy->page()->pageID());
}
-void LayerTreeHostProxy::setVisibleContentsRectAndScale(const IntRect& rect, float scale)
+void LayerTreeHostProxy::setVisibleContentsRectForScaling(const IntRect& rect, float scale)
{
m_visibleContentsRect = rect;
m_contentsScale = scale;
- m_drawingAreaProxy->page()->process()->send(Messages::LayerTreeHost::SetVisibleContentRectAndScale(rect, scale), m_drawingAreaProxy->page()->pageID());
+ m_drawingAreaProxy->page()->process()->send(Messages::LayerTreeHost::SetVisibleContentsRectForScaling(rect, scale), m_drawingAreaProxy->page()->pageID());
}
void LayerTreeHostProxy::purgeGLResources()
{
- TextureMapperNode* node = toTextureMapperNode(rootLayer());
+ TextureMapperLayer* layer = toTextureMapperLayer(rootLayer());
- if (node)
- node->purgeNodeTexturesRecursive();
+ if (layer)
+ layer->clearBackingStoresRecursive();
m_directlyCompositedImages.clear();
-
m_textureMapper.clear();
-
+ m_backingStoresWithPendingBuffers.clear();
m_drawingAreaProxy->page()->process()->send(Messages::LayerTreeHost::PurgeBackingStores(), m_drawingAreaProxy->page()->pageID());
}
diff --git a/Source/WebKit2/UIProcess/qt/QtDialogRunner.cpp b/Source/WebKit2/UIProcess/qt/QtDialogRunner.cpp
index f7e2b8514..16c642934 100644
--- a/Source/WebKit2/UIProcess/qt/QtDialogRunner.cpp
+++ b/Source/WebKit2/UIProcess/qt/QtDialogRunner.cpp
@@ -102,6 +102,39 @@ private:
QString m_prefilledUsername;
};
+class ProxyAuthenticationDialogContextObject : public QObject {
+ Q_OBJECT
+ Q_PROPERTY(QString hostname READ hostname CONSTANT)
+ Q_PROPERTY(quint16 port READ port CONSTANT)
+ Q_PROPERTY(QString prefilledUsername READ prefilledUsername CONSTANT)
+
+public:
+ ProxyAuthenticationDialogContextObject(const QString& hostname, quint16 port, const QString& prefilledUsername)
+ : QObject()
+ , m_hostname(hostname)
+ , m_port(port)
+ , m_prefilledUsername(prefilledUsername)
+ {
+ }
+
+ QString hostname() const { return m_hostname; }
+ quint16 port() const { return m_port; }
+ QString prefilledUsername() const { return m_prefilledUsername; }
+
+public slots:
+ void accept(const QString& username, const QString& password) { emit accepted(username, password); }
+ void reject() { emit rejected(); }
+
+signals:
+ void accepted(const QString& username, const QString& password);
+ void rejected();
+
+private:
+ QString m_hostname;
+ quint16 m_port;
+ QString m_prefilledUsername;
+};
+
class CertificateVerificationDialogContextObject : public QObject {
Q_OBJECT
Q_PROPERTY(QString hostname READ hostname CONSTANT)
@@ -174,6 +207,19 @@ bool QtDialogRunner::initForAuthentication(QDeclarativeComponent* component, QQu
return true;
}
+bool QtDialogRunner::initForProxyAuthentication(QDeclarativeComponent* component, QQuickItem* dialogParent, const QString& hostname, uint16_t port, const QString& prefilledUsername)
+{
+ ProxyAuthenticationDialogContextObject* contextObject = new ProxyAuthenticationDialogContextObject(hostname, port, prefilledUsername);
+ if (!createDialog(component, dialogParent, contextObject))
+ return false;
+
+ connect(contextObject, SIGNAL(accepted(QString, QString)), SLOT(onAuthenticationAccepted(QString, QString)));
+ connect(contextObject, SIGNAL(accepted(QString, QString)), SLOT(quit()));
+ connect(contextObject, SIGNAL(rejected()), SLOT(quit()));
+
+ return true;
+}
+
bool QtDialogRunner::initForCertificateVerification(QDeclarativeComponent* component, QQuickItem* dialogParent, const QString& hostname)
{
CertificateVerificationDialogContextObject* contextObject = new CertificateVerificationDialogContextObject(hostname);
diff --git a/Source/WebKit2/UIProcess/qt/QtDialogRunner.h b/Source/WebKit2/UIProcess/qt/QtDialogRunner.h
index 96dcea27f..7fbace1ce 100644
--- a/Source/WebKit2/UIProcess/qt/QtDialogRunner.h
+++ b/Source/WebKit2/UIProcess/qt/QtDialogRunner.h
@@ -40,6 +40,7 @@ public:
bool initForPrompt(QDeclarativeComponent*, QQuickItem* dialogParent, const QString& message, const QString& defaultValue);
bool initForAuthentication(QDeclarativeComponent*, QQuickItem* dialogParent, const QString& hostname, const QString& realm, const QString& prefilledUsername);
bool initForCertificateVerification(QDeclarativeComponent*, QQuickItem*, const QString& hostname);
+ bool initForProxyAuthentication(QDeclarativeComponent*, QQuickItem*, const QString& hostname, uint16_t port, const QString& prefilledUsername);
QQuickItem* dialog() const { return m_dialog.get(); }
diff --git a/Source/WebKit2/UIProcess/qt/QtFlickProvider.cpp b/Source/WebKit2/UIProcess/qt/QtFlickProvider.cpp
new file mode 100644
index 000000000..3760c0cfb
--- /dev/null
+++ b/Source/WebKit2/UIProcess/qt/QtFlickProvider.cpp
@@ -0,0 +1,224 @@
+/*
+ * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this program; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+#include "QtFlickProvider.h"
+
+#include "qquickwebpage_p.h"
+#include "qquickwebview_p.h"
+
+#include <QCoreApplication>
+#include <QDeclarativeEngine>
+#include <QPointF>
+#include <QQuickItem>
+#include <QTouchEvent>
+#include <wtf/Assertions.h>
+
+namespace {
+
+inline QMetaMethod resolveMetaMethod(QObject* flickable, const char* name)
+{
+ ASSERT(flickable);
+
+ const QMetaObject* metaObject = flickable->metaObject();
+ ASSERT(metaObject);
+
+ int methodIndex = metaObject->indexOfMethod(name);
+ ASSERT(methodIndex != -1);
+
+ return metaObject->method(methodIndex);
+}
+
+inline QMetaProperty resolveMetaProperty(QObject* flickable, const char* name)
+{
+ ASSERT(flickable);
+
+ const QMetaObject* metaObject = flickable->metaObject();
+ ASSERT(metaObject);
+
+ int propertyIndex = metaObject->indexOfProperty(name);
+ ASSERT(propertyIndex != -1);
+
+ return metaObject->property(propertyIndex);
+}
+
+} // namespace
+
+QtFlickProvider::QtFlickProvider(QQuickWebView* viewItem, QQuickWebPage* pageItem)
+ : QObject(viewItem)
+{
+ ASSERT(viewItem);
+ ASSERT(pageItem);
+
+ QDeclarativeEngine* engine = qmlEngine(viewItem);
+ QDeclarativeContext* context = qmlContext(viewItem);
+
+ ASSERT(engine);
+ ASSERT(context);
+
+ QDeclarativeComponent component(engine, viewItem);
+
+ // Create the internal Flickable instance dynamically.
+ // We only use public QML API so that we do not depend
+ // on private API of the QtDeclarative module.
+ component.setData(QByteArrayLiteral("import QtQuick 2.0\nFlickable {}"), QUrl());
+
+ m_flickable = qobject_cast<QQuickItem*>(component.create(context));
+
+ QMetaProperty content = resolveMetaProperty(m_flickable, "contentItem");
+ m_contentItem = content.read(m_flickable).value<QQuickItem*>();
+ ASSERT(m_contentItem);
+
+ // Resolve meta methods and properties of the Flickable instance.
+ m_returnToBoundsMethod = resolveMetaMethod(m_flickable, "returnToBounds()");
+ m_cancelFlickMethod = resolveMetaMethod(m_flickable, "cancelFlick()");
+
+ m_contentWidth = resolveMetaProperty(m_flickable, "contentWidth");
+ m_contentHeight = resolveMetaProperty(m_flickable, "contentHeight");
+ m_contentX = resolveMetaProperty(m_flickable, "contentX");
+ m_contentY = resolveMetaProperty(m_flickable, "contentY");
+ m_moving = resolveMetaProperty(m_flickable, "moving");
+ m_dragging = resolveMetaProperty(m_flickable, "dragging");
+ m_flicking = resolveMetaProperty(m_flickable, "flicking");
+
+ m_flickableData = resolveMetaProperty(m_flickable, "flickableData");
+
+ // Set the viewItem as the parent of the flickable instance
+ // and reparent the page so it is placed on the flickable contentItem.
+ m_flickable->setParentItem(viewItem);
+ pageItem->setParentItem(m_contentItem);
+
+ // Propagate flickable signals.
+ connect(m_flickable, SIGNAL(movingChanged()), SIGNAL(movingChanged()), Qt::DirectConnection);
+ connect(m_flickable, SIGNAL(flickingChanged()), SIGNAL(flickingChanged()), Qt::DirectConnection);
+ connect(m_flickable, SIGNAL(draggingChanged()), SIGNAL(draggingChanged()), Qt::DirectConnection);
+ connect(m_flickable, SIGNAL(contentWidthChanged()), SIGNAL(contentWidthChanged()), Qt::DirectConnection);
+ connect(m_flickable, SIGNAL(contentHeightChanged()), SIGNAL(contentHeightChanged()), Qt::DirectConnection);
+ connect(m_flickable, SIGNAL(contentXChanged()), SIGNAL(contentXChanged()), Qt::DirectConnection);
+ connect(m_flickable, SIGNAL(contentYChanged()), SIGNAL(contentYChanged()), Qt::DirectConnection);
+}
+
+void QtFlickProvider::handleTouchFlickEvent(QTouchEvent* event)
+{
+ QCoreApplication::sendEvent(m_flickable, event);
+}
+
+QQuickItem* QtFlickProvider::contentItem()
+{
+ ASSERT(m_contentItem);
+ return m_contentItem;
+}
+
+QDeclarativeListProperty<QObject> QtFlickProvider::flickableData()
+{
+ return m_flickableData.read(m_flickable).value<QDeclarativeListProperty<QObject> >();
+}
+
+QPointF QtFlickProvider::contentPos() const
+{
+ qreal x = m_contentX.read(m_flickable).value<qreal>();
+ qreal y = m_contentY.read(m_flickable).value<qreal>();
+ return QPointF(x, y);
+}
+void QtFlickProvider::setContentPos(const QPointF& pos)
+{
+ m_contentX.write(m_flickable, pos.x());
+ m_contentY.write(m_flickable, pos.y());
+}
+
+QSizeF QtFlickProvider::viewportSize() const
+{
+ qreal width = m_flickable->width();
+ qreal height = m_flickable->height();
+
+ return QSizeF(width, height);
+}
+
+void QtFlickProvider::setViewportSize(const QSizeF& size)
+{
+ ASSERT(size.isValid());
+ m_flickable->setWidth(size.width());
+ m_flickable->setHeight(size.height());
+}
+
+void QtFlickProvider::returnToBounds()
+{
+ m_returnToBoundsMethod.invoke(m_flickable, Qt::DirectConnection);
+}
+
+void QtFlickProvider::cancelFlick()
+{
+ m_cancelFlickMethod.invoke(m_flickable, Qt::DirectConnection);
+}
+
+bool QtFlickProvider::isMoving() const
+{
+ return m_moving.read(m_flickable).value<bool>();
+}
+
+bool QtFlickProvider::isDragging() const
+{
+ return m_dragging.read(m_flickable).value<bool>();
+}
+
+bool QtFlickProvider::isFlicking() const
+{
+ return m_flicking.read(m_flickable).value<bool>();
+}
+
+qreal QtFlickProvider::contentWidth() const
+{
+ return m_contentWidth.read(m_flickable).value<qreal>();
+}
+
+void QtFlickProvider::setContentWidth(qreal width)
+{
+ m_contentWidth.write(m_flickable, width);
+}
+
+qreal QtFlickProvider::contentHeight() const
+{
+ return m_contentHeight.read(m_flickable).value<qreal>();
+}
+
+void QtFlickProvider::setContentHeight(qreal height)
+{
+ m_contentHeight.write(m_flickable, height);
+}
+
+qreal QtFlickProvider::contentX() const
+{
+ return m_contentX.read(m_flickable).value<qreal>();
+}
+
+void QtFlickProvider::setContentX(qreal x)
+{
+ m_contentX.write(m_flickable, x);
+}
+
+qreal QtFlickProvider::contentY() const
+{
+ return m_contentY.read(m_flickable).value<qreal>();
+}
+
+void QtFlickProvider::setContentY(qreal y)
+{
+ m_contentY.write(m_flickable, y);
+}
diff --git a/Source/WebKit2/UIProcess/qt/QtFlickProvider.h b/Source/WebKit2/UIProcess/qt/QtFlickProvider.h
new file mode 100644
index 000000000..f388a0b4b
--- /dev/null
+++ b/Source/WebKit2/UIProcess/qt/QtFlickProvider.h
@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this program; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef QtFlickProvider_h
+#define QtFlickProvider_h
+
+#include <QDeclarativeListProperty>
+#include <QMetaMethod>
+#include <QMetaProperty>
+#include <QObject>
+
+QT_BEGIN_NAMESPACE
+class QPointF;
+class QSizeF;
+class QQuickItem;
+class QQuickWebPage;
+class QQuickWebView;
+class QTouchEvent;
+QT_END_NAMESPACE
+
+class QtFlickProvider : public QObject {
+ Q_OBJECT
+public:
+ QtFlickProvider(QQuickWebView* viewItem, QQuickWebPage* pageItem);
+
+ void handleTouchFlickEvent(QTouchEvent*);
+
+ QQuickItem* contentItem();
+ QDeclarativeListProperty<QObject> flickableData();
+
+ QPointF contentPos() const;
+ void setContentPos(const QPointF&);
+
+ QSizeF viewportSize() const;
+ void setViewportSize(const QSizeF&);
+
+ void returnToBounds();
+ void cancelFlick();
+
+ bool isMoving() const;
+ bool isDragging() const;
+ bool isFlicking() const;
+
+ qreal contentWidth() const;
+ void setContentWidth(qreal);
+ qreal contentHeight() const;
+ void setContentHeight(qreal);
+ qreal contentX() const;
+ void setContentX(qreal);
+ qreal contentY() const;
+ void setContentY(qreal);
+
+Q_SIGNALS:
+ void contentWidthChanged();
+ void contentHeightChanged();
+ void contentXChanged();
+ void contentYChanged();
+ void movingChanged();
+ void flickingChanged();
+ void draggingChanged();
+
+private:
+ QMetaMethod m_returnToBoundsMethod;
+ QMetaMethod m_cancelFlickMethod;
+
+ QMetaProperty m_contentWidth;
+ QMetaProperty m_contentHeight;
+ QMetaProperty m_contentX;
+ QMetaProperty m_contentY;
+
+ QMetaProperty m_moving;
+ QMetaProperty m_dragging;
+ QMetaProperty m_flicking;
+
+ QMetaProperty m_flickableData;
+
+ QQuickItem* m_contentItem;
+ QQuickItem* m_flickable;
+};
+
+#endif // QtFlickProvider_h
diff --git a/Source/WebKit2/UIProcess/qt/QtPageClient.cpp b/Source/WebKit2/UIProcess/qt/QtPageClient.cpp
index cdc863b61..8d6ebbb03 100644
--- a/Source/WebKit2/UIProcess/qt/QtPageClient.cpp
+++ b/Source/WebKit2/UIProcess/qt/QtPageClient.cpp
@@ -123,6 +123,17 @@ void QtPageClient::handleCertificateVerificationRequest(const String& hostname,
ignoreErrors = QQuickWebViewPrivate::get(m_webView)->handleCertificateVerificationRequest(hostname);
}
+void QtPageClient::handleProxyAuthenticationRequiredRequest(const String& hostname, uint16_t port, const String& prefilledUsername, String& username, String& password)
+{
+ QString qUsername;
+ QString qPassword;
+
+ QQuickWebViewPrivate::get(m_webView)->handleProxyAuthenticationRequiredRequest(hostname, port, prefilledUsername, qUsername, qPassword);
+
+ username = qUsername;
+ password = qPassword;
+}
+
void QtPageClient::setCursor(const WebCore::Cursor& cursor)
{
// FIXME: This is a temporary fix until we get cursor support in QML items.
diff --git a/Source/WebKit2/UIProcess/qt/QtPageClient.h b/Source/WebKit2/UIProcess/qt/QtPageClient.h
index 43050f502..f4ffa18ad 100644
--- a/Source/WebKit2/UIProcess/qt/QtPageClient.h
+++ b/Source/WebKit2/UIProcess/qt/QtPageClient.h
@@ -56,6 +56,7 @@ public:
virtual void handleApplicationSchemeRequest(PassRefPtr<QtRefCountedNetworkRequestData>);
virtual void handleAuthenticationRequiredRequest(const String& hostname, const String& realm, const String& prefilledUsername, String& username, String& password);
virtual void handleCertificateVerificationRequest(const String& hostname, bool& ignoreErrors);
+ virtual void handleProxyAuthenticationRequiredRequest(const String& hostname, uint16_t port, const String& prefilledUsername, String& username, String& password);
virtual void displayView();
virtual void scrollView(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset);
diff --git a/Source/WebKit2/UIProcess/qt/QtPanGestureRecognizer.cpp b/Source/WebKit2/UIProcess/qt/QtPanGestureRecognizer.cpp
index 6f93c9391..1787391b7 100644
--- a/Source/WebKit2/UIProcess/qt/QtPanGestureRecognizer.cpp
+++ b/Source/WebKit2/UIProcess/qt/QtPanGestureRecognizer.cpp
@@ -37,7 +37,7 @@ QtPanGestureRecognizer::QtPanGestureRecognizer(QtWebPageEventHandler* eventHandl
reset();
}
-bool QtPanGestureRecognizer::recognize(const QTouchEvent* event, qint64 eventTimestampMillis)
+bool QtPanGestureRecognizer::recognize(const QTouchEvent* event)
{
if (!interactionEngine())
return false;
@@ -62,6 +62,7 @@ bool QtPanGestureRecognizer::recognize(const QTouchEvent* event, qint64 eventTim
ASSERT(m_state == NoGesture);
m_state = GestureRecognitionStarted;
m_firstPosition = touchPoint.screenPos();
+ m_touchBegin.reset(new QTouchEvent(*event));
return false;
case QEvent::TouchUpdate: {
ASSERT(m_state != NoGesture);
@@ -73,16 +74,17 @@ bool QtPanGestureRecognizer::recognize(const QTouchEvent* event, qint64 eventTim
return false;
m_state = GestureRecognized;
- interactionEngine()->panGestureStarted(touchPoint.pos(), eventTimestampMillis);
+ ASSERT(m_touchBegin);
+ interactionEngine()->panGestureStarted(m_touchBegin.data());
}
ASSERT(m_state == GestureRecognized);
- interactionEngine()->panGestureRequestUpdate(touchPoint.pos(), eventTimestampMillis);
+ interactionEngine()->panGestureRequestUpdate(event);
return true;
}
case QEvent::TouchEnd:
if (m_state == GestureRecognized) {
- interactionEngine()->panGestureEnded(touchPoint.pos(), eventTimestampMillis);
+ interactionEngine()->panGestureEnded(event);
reset();
return true;
}
diff --git a/Source/WebKit2/UIProcess/qt/QtPanGestureRecognizer.h b/Source/WebKit2/UIProcess/qt/QtPanGestureRecognizer.h
index 532507e09..e1e9ff3fd 100644
--- a/Source/WebKit2/UIProcess/qt/QtPanGestureRecognizer.h
+++ b/Source/WebKit2/UIProcess/qt/QtPanGestureRecognizer.h
@@ -29,6 +29,7 @@
#include "QtGestureRecognizer.h"
#include <QPointF>
+#include <QScopedPointer>
#include <QtCore/QtGlobal>
QT_BEGIN_NAMESPACE
@@ -42,11 +43,12 @@ const qreal panningInitialTriggerDistanceThreshold = 5.;
class QtPanGestureRecognizer : public QtGestureRecognizer {
public:
QtPanGestureRecognizer(QtWebPageEventHandler*);
- bool recognize(const QTouchEvent*, qint64 eventTimestampMillis);
+ bool recognize(const QTouchEvent*);
void reset();
private:
QPointF m_firstPosition;
+ QScopedPointer<QTouchEvent> m_touchBegin;
};
} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp b/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp
index 62400fa42..bfec37138 100644
--- a/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp
+++ b/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp
@@ -23,12 +23,10 @@
#include "QtViewportInteractionEngine.h"
#include "PassOwnPtr.h"
+#include "QtFlickProvider.h"
#include "qquickwebpage_p.h"
#include "qquickwebview_p.h"
#include <QPointF>
-#include <QScrollEvent>
-#include <QScrollPrepareEvent>
-#include <QScrollerProperties>
#include <QTransform>
#include <QWheelEvent>
#include <QtQuick/qquickitem.h>
@@ -80,7 +78,7 @@ public:
emit engine->contentResumeRequested();
// Make sure that tiles all around the viewport will be requested.
- emit engine->viewportTrajectoryVectorChanged(QPointF());
+ emit engine->contentWasMoved(QPointF());
}
private:
@@ -114,41 +112,25 @@ inline QRectF QtViewportInteractionEngine::itemRectFromCSS(const QRectF& cssRect
return itemRect;
}
-QtViewportInteractionEngine::QtViewportInteractionEngine(const QQuickWebView* viewport, QQuickWebPage* content)
+QtViewportInteractionEngine::QtViewportInteractionEngine(QQuickWebView* viewport, QQuickWebPage* content, QtFlickProvider* flickProvider)
: m_viewport(viewport)
, m_content(content)
+ , m_flickProvider(flickProvider)
, m_suspendCount(0)
+ , m_hadUserInteraction(false)
, m_scaleAnimation(new ScaleAnimation(this))
, m_pinchStartScale(-1)
{
reset();
- QScrollerProperties properties = scroller()->scrollerProperties();
-
- // The QtPanGestureRecognizer is responsible for recognizing the gesture
- // thus we need to disable the drag start distance.
- properties.setScrollMetric(QScrollerProperties::DragStartDistance, 0.0);
-
- // Set some default QScroller constrains to mimic the physics engine of the N9 browser.
- properties.setScrollMetric(QScrollerProperties::AxisLockThreshold, 0.66);
- properties.setScrollMetric(QScrollerProperties::ScrollingCurve, QEasingCurve(QEasingCurve::OutExpo));
- properties.setScrollMetric(QScrollerProperties::DecelerationFactor, 0.05);
- properties.setScrollMetric(QScrollerProperties::MaximumVelocity, 0.635);
- properties.setScrollMetric(QScrollerProperties::OvershootDragResistanceFactor, 0.33);
- properties.setScrollMetric(QScrollerProperties::OvershootScrollDistanceFactor, 0.33);
-
- scroller()->setScrollerProperties(properties);
-
- connect(m_content, SIGNAL(widthChanged()), this, SLOT(itemSizeChanged()), Qt::DirectConnection);
- connect(m_content, SIGNAL(heightChanged()), this, SLOT(itemSizeChanged()), Qt::DirectConnection);
+ connect(m_content, SIGNAL(widthChanged()), SLOT(itemSizeChanged()), Qt::DirectConnection);
+ connect(m_content, SIGNAL(heightChanged()), SLOT(itemSizeChanged()), Qt::DirectConnection);
+ connect(m_flickProvider, SIGNAL(movingChanged()), SLOT(flickableMovingStateChanged()), Qt::DirectConnection);
connect(m_scaleAnimation, SIGNAL(valueChanged(QVariant)),
SLOT(scaleAnimationValueChanged(QVariant)), Qt::DirectConnection);
connect(m_scaleAnimation, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)),
SLOT(scaleAnimationStateChanged(QAbstractAnimation::State, QAbstractAnimation::State)), Qt::DirectConnection);
-
- connect(scroller(), SIGNAL(stateChanged(QScroller::State)),
- SLOT(scrollStateChanged(QScroller::State)), Qt::DirectConnection);
}
QtViewportInteractionEngine::~QtViewportInteractionEngine()
@@ -182,9 +164,11 @@ void QtViewportInteractionEngine::setItemRectVisible(const QRectF& itemRect)
m_content->setContentsScale(itemScale);
- // We need to animate the content but the position represents the viewport hence we need to invert the position here.
- // To animate the position together with the scale we multiply the position with the current scale;
- m_content->setPos(- itemRect.topLeft() * itemScale);
+ // To animate the position together with the scale we multiply the position with the current scale
+ // and add it to the page position (displacement on the flickable contentItem because of additional items).
+ QPointF newPosition(m_content->pos() + (itemRect.topLeft() * itemScale));
+
+ m_flickProvider->setContentPos(newPosition);
}
bool QtViewportInteractionEngine::animateItemRectVisible(const QRectF& itemRect)
@@ -203,6 +187,44 @@ bool QtViewportInteractionEngine::animateItemRectVisible(const QRectF& itemRect)
return true;
}
+void QtViewportInteractionEngine::flickableMovingStateChanged()
+{
+ if (m_flickProvider->isMoving()) {
+ if (m_scrollUpdateDeferrer)
+ return; // We get the isMoving() signal multiple times.
+ panMoveStarted();
+ } else
+ panMoveEnded();
+}
+
+void QtViewportInteractionEngine::panMoveStarted()
+{
+ m_scrollUpdateDeferrer = adoptPtr(new ViewportUpdateDeferrer(this));
+
+ m_lastScrollPosition = m_flickProvider->contentPos();
+ connect(m_flickProvider, SIGNAL(contentXChanged()), SLOT(flickableMovingPositionUpdate()));
+ connect(m_flickProvider, SIGNAL(contentYChanged()), SLOT(flickableMovingPositionUpdate()));
+}
+
+void QtViewportInteractionEngine::panMoveEnded()
+{
+ // This method is called on the end of the pan or pan kinetic animation.
+ m_scrollUpdateDeferrer.clear();
+
+ m_lastScrollPosition = QPointF();
+ disconnect(m_flickProvider, SIGNAL(contentXChanged()), this, SLOT(flickableMovingPositionUpdate()));
+ disconnect(m_flickProvider, SIGNAL(contentYChanged()), this, SLOT(flickableMovingPositionUpdate()));
+}
+
+void QtViewportInteractionEngine::flickableMovingPositionUpdate()
+{
+ QPointF newPosition = m_flickProvider->contentPos();
+
+ emit contentWasMoved(m_lastScrollPosition - newPosition);
+
+ m_lastScrollPosition = newPosition;
+}
+
void QtViewportInteractionEngine::scaleAnimationStateChanged(QAbstractAnimation::State newState, QAbstractAnimation::State /*oldState*/)
{
switch (newState) {
@@ -218,60 +240,6 @@ void QtViewportInteractionEngine::scaleAnimationStateChanged(QAbstractAnimation:
}
}
-void QtViewportInteractionEngine::scrollStateChanged(QScroller::State newState)
-{
- switch (newState) {
- case QScroller::Inactive:
- // FIXME: QScroller gets when even when tapping while it is scrolling.
- m_scrollUpdateDeferrer.clear();
- break;
- case QScroller::Pressed:
- case QScroller::Dragging:
- case QScroller::Scrolling:
- if (m_scrollUpdateDeferrer)
- break;
- m_scrollUpdateDeferrer = adoptPtr(new ViewportUpdateDeferrer(this));
- break;
- default:
- break;
- }
-}
-
-bool QtViewportInteractionEngine::event(QEvent* event)
-{
- switch (event->type()) {
- case QEvent::ScrollPrepare: {
- QScrollPrepareEvent* prepareEvent = static_cast<QScrollPrepareEvent*>(event);
- const QRectF viewportRect = m_viewport->boundingRect();
- const QRectF contentRect = m_viewport->mapRectFromItem(m_content, m_content->boundingRect());
- const QRectF posRange = computePosRangeForItemAtScale(m_content->contentsScale());
- prepareEvent->setContentPosRange(posRange);
- prepareEvent->setViewportSize(viewportRect.size());
-
- // As we want to push the contents and not actually scroll it, we need to invert the positions here.
- prepareEvent->setContentPos(-contentRect.topLeft());
- prepareEvent->accept();
- return true;
- }
- case QEvent::Scroll: {
- QScrollEvent* scrollEvent = static_cast<QScrollEvent*>(event);
- QPointF newPos = -scrollEvent->contentPos() - scrollEvent->overshootDistance();
- if (m_content->pos() != newPos) {
- QPointF currentPosInCSSCoordinates = m_viewport->mapToWebContent(m_content->pos());
- QPointF newPosInCSSCoordinates = m_viewport->mapToWebContent(newPos);
-
- // This must be emitted before viewportUpdateRequested so that the web process knows where to look for tiles.
- emit viewportTrajectoryVectorChanged(currentPosInCSSCoordinates - newPosInCSSCoordinates);
- m_content->setPos(newPos);
- }
- return true;
- }
- default:
- break;
- }
- return QObject::event(event);
-}
-
static inline QPointF boundPosition(const QPointF minPosition, const QPointF& position, const QPointF& maxPosition)
{
return QPointF(qBound(minPosition.x(), position.x(), maxPosition.x()),
@@ -304,9 +272,12 @@ void QtViewportInteractionEngine::wheelEvent(QWheelEvent* ev)
newPos.ry() += delta;
QRectF endPosRange = computePosRangeForItemAtScale(m_content->contentsScale());
- m_content->setPos(-boundPosition(endPosRange.topLeft(), newPos, endPosRange.bottomRight()));
- emit visibleContentRectAndScaleChanged();
+ QPointF currentPosition = m_flickProvider->contentPos();
+ QPointF newPosition = -boundPosition(endPosRange.topLeft(), newPos, endPosRange.bottomRight());
+ m_flickProvider->setContentPos(newPosition);
+
+ emit contentWasMoved(currentPosition - newPosition);
}
void QtViewportInteractionEngine::pagePositionRequest(const QPoint& pagePosition)
@@ -434,8 +405,10 @@ void QtViewportInteractionEngine::reset()
m_hadUserInteraction = false;
- scroller()->stop();
+ m_flickProvider->cancelFlick();
m_scaleAnimation->stop();
+ m_scaleUpdateDeferrer.clear();
+ m_scrollUpdateDeferrer.clear();
}
void QtViewportInteractionEngine::applyConstraints(const Constraints& constraints)
@@ -452,7 +425,7 @@ void QtViewportInteractionEngine::applyConstraints(const Constraints& constraint
m_content->setContentsScale(itemScaleFromCSS(initialScale));
}
- // If the web app changes successively changes the viewport on purpose
+ // If the web app successively changes the viewport on purpose
// it wants to be in control and we should disable animations.
ensureContentWithinViewportBoundary(/* immediate */ true);
}
@@ -464,44 +437,49 @@ qreal QtViewportInteractionEngine::currentCSSScale()
bool QtViewportInteractionEngine::scrollAnimationActive() const
{
- QScroller* scroller = const_cast<QtViewportInteractionEngine*>(this)->scroller();
- return scroller->state() == QScroller::Scrolling;
-}
-
-void QtViewportInteractionEngine::interruptScrollAnimation()
-{
- // Stopping the scroller immediately stops kinetic scrolling and if the view is out of bounds it
- // is moved inside valid bounds immediately as well. This is the behavior that we want.
- scroller()->stop();
+ return m_flickProvider->isFlicking();
}
bool QtViewportInteractionEngine::panGestureActive() const
{
- QScroller* scroller = const_cast<QtViewportInteractionEngine*>(this)->scroller();
- return scroller->state() == QScroller::Pressed || scroller->state() == QScroller::Dragging;
+ return m_flickProvider->isDragging();
}
-void QtViewportInteractionEngine::panGestureStarted(const QPointF& viewportTouchPoint, qint64 eventTimestampMillis)
+void QtViewportInteractionEngine::panGestureStarted(const QTouchEvent* event)
{
m_hadUserInteraction = true;
- scroller()->handleInput(QScroller::InputPress, viewportTouchPoint, eventTimestampMillis);
+
+ ASSERT(event->type() == QEvent::TouchBegin);
+
+ m_flickProvider->handleTouchFlickEvent(const_cast<QTouchEvent*>(event));
+ m_lastPinchCenterInViewportCoordinates = event->touchPoints().first().pos();
}
-void QtViewportInteractionEngine::panGestureRequestUpdate(const QPointF& viewportTouchPoint, qint64 eventTimestampMillis)
+void QtViewportInteractionEngine::panGestureRequestUpdate(const QTouchEvent* event)
{
- scroller()->handleInput(QScroller::InputMove, viewportTouchPoint, eventTimestampMillis);
+ ASSERT(event->type() == QEvent::TouchUpdate);
+
+ m_flickProvider->handleTouchFlickEvent(const_cast<QTouchEvent*>(event));
+ m_lastPinchCenterInViewportCoordinates = event->touchPoints().first().pos();
}
void QtViewportInteractionEngine::panGestureCancelled()
{
- // Stopping the scroller immediately stops kinetic scrolling and if the view is out of bounds it
- // is moved inside valid bounds immediately as well. This is the behavior that we want.
- scroller()->stop();
+ // Reset the velocity samples of the flickable.
+ // This should only be called by the recognizer if we have a recognized
+ // pan gesture and receive a touch event with multiple touch points
+ // (ie. transition to a pinch gesture) as it does not move the content
+ // back inside valid bounds.
+ // When the pinch gesture ends, the content is positioned and scaled
+ // back to valid boundaries.
+ m_flickProvider->cancelFlick();
}
-void QtViewportInteractionEngine::panGestureEnded(const QPointF& viewportTouchPoint, qint64 eventTimestampMillis)
+void QtViewportInteractionEngine::panGestureEnded(const QTouchEvent* event)
{
- scroller()->handleInput(QScroller::InputRelease, viewportTouchPoint, eventTimestampMillis);
+ ASSERT(event->type() == QEvent::TouchEnd);
+ m_flickProvider->handleTouchFlickEvent(const_cast<QTouchEvent*>(event));
+ m_lastPinchCenterInViewportCoordinates = event->touchPoints().first().pos();
}
bool QtViewportInteractionEngine::scaleAnimationActive() const
@@ -535,7 +513,7 @@ void QtViewportInteractionEngine::pinchGestureStarted(const QPointF& pinchCenter
m_pinchStartScale = m_content->contentsScale();
// Reset the tiling look-ahead vector so that tiles all around the viewport will be requested on pinch-end.
- emit viewportTrajectoryVectorChanged(QPointF());
+ emit contentWasMoved(QPointF());
}
void QtViewportInteractionEngine::pinchGestureRequestUpdate(const QPointF& pinchCenterInViewportCoordinates, qreal totalScaleFactor)
@@ -557,7 +535,7 @@ void QtViewportInteractionEngine::pinchGestureRequestUpdate(const QPointF& pinch
const QPointF positionDiff = pinchCenterInViewportCoordinates - m_lastPinchCenterInViewportCoordinates;
m_lastPinchCenterInViewportCoordinates = pinchCenterInViewportCoordinates;
- m_content->setPos(m_content->pos() + positionDiff);
+ m_flickProvider->setContentPos(m_flickProvider->contentPos() - positionDiff);
}
void QtViewportInteractionEngine::pinchGestureEnded()
@@ -588,7 +566,8 @@ void QtViewportInteractionEngine::scaleContent(const QPointF& centerInCSSCoordin
QPointF oldPinchCenterOnViewport = m_viewport->mapFromWebContent(centerInCSSCoordinates);
m_content->setContentsScale(itemScaleFromCSS(cssScale));
QPointF newPinchCenterOnViewport = m_viewport->mapFromWebContent(centerInCSSCoordinates);
- m_content->setPos(m_content->pos() - (newPinchCenterOnViewport - oldPinchCenterOnViewport));
+
+ m_flickProvider->setContentPos(m_flickProvider->contentPos() + (newPinchCenterOnViewport - oldPinchCenterOnViewport));
}
#include "moc_QtViewportInteractionEngine.cpp"
diff --git a/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h b/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h
index a4b699030..9419be0f6 100644
--- a/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h
+++ b/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h
@@ -23,8 +23,8 @@
#define QtViewportInteractionEngine_h
#include "OwnPtr.h"
-#include <QScroller>
#include "qwebkitglobal.h"
+#include <QTouchEvent>
#include <QtCore/QObject>
#include <QtCore/QRectF>
#include <QtCore/QVariant>
@@ -33,6 +33,7 @@
QT_BEGIN_NAMESPACE
class QPointF;
class QQuickItem;
+class QtFlickProvider;
class QQuickWebPage;
class QQuickWebView;
class QWheelEvent;
@@ -46,7 +47,7 @@ class QtViewportInteractionEngine : public QObject {
Q_OBJECT
public:
- QtViewportInteractionEngine(const QQuickWebView*, QQuickWebPage*);
+ QtViewportInteractionEngine(QQuickWebView*, QQuickWebPage*, QtFlickProvider*);
~QtViewportInteractionEngine();
struct Constraints {
@@ -67,8 +68,6 @@ public:
QSize layoutSize;
};
- bool event(QEvent*);
-
void reset();
void applyConstraints(const Constraints&);
@@ -79,13 +78,12 @@ public:
void pagePositionRequest(const QPoint& pos);
bool scrollAnimationActive() const;
- void interruptScrollAnimation();
bool panGestureActive() const;
- void panGestureStarted(const QPointF& viewportTouchPoint, qint64 eventTimestampMillis);
- void panGestureRequestUpdate(const QPointF& viewportTouchPoint, qint64 eventTimestampMillis);
+ void panGestureStarted(const QTouchEvent*);
+ void panGestureRequestUpdate(const QTouchEvent*);
void panGestureCancelled();
- void panGestureEnded(const QPointF& viewportTouchPoint, qint64 eventTimestampMillis);
+ void panGestureEnded(const QTouchEvent*);
bool scaleAnimationActive() const;
void interruptScaleAnimation();
@@ -105,6 +103,9 @@ Q_SIGNALS:
void contentSuspendRequested();
void contentResumeRequested();
+ void contentWasMoved(const QPointF& trajectoryVector);
+ void contentWasScaled();
+
void viewportTrajectoryVectorChanged(const QPointF&);
void visibleContentRectAndScaleChanged();
@@ -112,7 +113,9 @@ private Q_SLOTS:
// Respond to changes of content that are not driven by us, like the page resizing itself.
void itemSizeChanged();
- void scrollStateChanged(QScroller::State);
+ void flickableMovingStateChanged();
+ void flickableMovingPositionUpdate();
+
void scaleAnimationStateChanged(QAbstractAnimation::State, QAbstractAnimation::State);
void scaleAnimationValueChanged(QVariant value) { setItemRectVisible(value.toRectF()); }
@@ -127,18 +130,19 @@ private:
qreal innerBoundedCSSScale(qreal);
qreal outerBoundedCSSScale(qreal);
+ void panMoveStarted(); // Called when panning starts.
+ void panMoveEnded(); // Called when panning (+ kinetic animation) ends.
+
QRectF computePosRangeForItemAtScale(qreal itemScale) const;
bool ensureContentWithinViewportBoundary(bool immediate = false);
void scaleContent(const QPointF& centerInCSSCoordinates, qreal cssScale);
- // As long as the object exists this function will always return the same QScroller instance.
- QScroller* scroller() { return QScroller::scroller(this); }
-
-
- const QQuickWebView* const m_viewport;
+ QQuickWebView* const m_viewport;
QQuickWebPage* const m_content;
+ QtFlickProvider* const m_flickProvider;
+
Constraints m_constraints;
int m_suspendCount;
@@ -158,6 +162,7 @@ private:
ScaleAnimation* m_scaleAnimation;
QPointF m_lastPinchCenterInViewportCoordinates;
+ QPointF m_lastScrollPosition;
qreal m_pinchStartScale;
};
diff --git a/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp b/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp
index a07967801..7d089929a 100644
--- a/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp
+++ b/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp
@@ -27,6 +27,7 @@
#include "QtViewportInteractionEngine.h"
#include "qquickwebpage_p.h"
#include "qquickwebview_p.h"
+#include <QCursor>
#include <QDrag>
#include <QGraphicsSceneMouseEvent>
#include <QGuiApplication>
@@ -142,6 +143,7 @@ bool QtWebPageEventHandler::handleEvent(QEvent* ev)
return handleFocusOutEvent(static_cast<QFocusEvent*>(ev));
case QEvent::TouchBegin:
case QEvent::TouchEnd:
+ case QEvent::TouchCancel:
case QEvent::TouchUpdate:
touchEvent(static_cast<QTouchEvent*>(ev));
return true;
@@ -461,8 +463,6 @@ void QtWebPageEventHandler::updateTextInputState()
const EditorState& editor = m_webPageProxy->editorState();
- m_webView->setInputMethodHints(Qt::InputMethodHints(editor.inputMethodHints));
-
if (!m_webView->hasFocus())
return;
@@ -507,8 +507,7 @@ void QtWebPageEventHandler::doneWithTouchEvent(const NativeWebTouchEvent& event,
// The interaction engine might still be animating kinetic scrolling or a scale animation
// such as double-tap to zoom or the bounce back effect. A touch stops the kinetic scrolling
// where as it does not stop the scale animation.
- if (m_interactionEngine->scrollAnimationActive())
- m_interactionEngine->interruptScrollAnimation();
+ // Sending the event to the flickProvider will stop the kinetic scrolling animation.
break;
case QEvent::TouchUpdate:
// The scale animation can only be interrupted by a pinch gesture, which will then take over.
@@ -524,15 +523,14 @@ void QtWebPageEventHandler::doneWithTouchEvent(const NativeWebTouchEvent& event,
if (m_interactionEngine->scaleAnimationActive())
return;
- // Convert the event timestamp from second to millisecond.
- qint64 eventTimestampMillis = static_cast<qint64>(event.timestamp() * 1000);
- m_panGestureRecognizer.recognize(ev, eventTimestampMillis);
+ m_panGestureRecognizer.recognize(ev);
m_pinchGestureRecognizer.recognize(ev);
if (m_panGestureRecognizer.isRecognized() || m_pinchGestureRecognizer.isRecognized())
m_tapGestureRecognizer.reset();
else {
- const QTouchEvent* ev = event.nativeEvent();
+ // Convert the event timestamp from second to millisecond.
+ qint64 eventTimestampMillis = static_cast<qint64>(event.timestamp() * 1000);
m_tapGestureRecognizer.recognize(ev, eventTimestampMillis);
}
}
diff --git a/Source/WebKit2/UIProcess/qt/QtWebPagePolicyClient.cpp b/Source/WebKit2/UIProcess/qt/QtWebPagePolicyClient.cpp
index e77fb1463..ad8ced73f 100644
--- a/Source/WebKit2/UIProcess/qt/QtWebPagePolicyClient.cpp
+++ b/Source/WebKit2/UIProcess/qt/QtWebPagePolicyClient.cpp
@@ -23,7 +23,6 @@
#include "WKFrame.h"
#include "WKURLQt.h"
-#include "qquickwebview_p.h"
#include "qquickwebview_p_p.h"
#include "qwebnavigationrequest_p.h"
#include <QtCore/QObject>
@@ -42,11 +41,12 @@ QtWebPagePolicyClient::QtWebPagePolicyClient(WKPageRef pageRef, QQuickWebView* w
WKPageSetPagePolicyClient(pageRef, &policyClient);
}
-void QtWebPagePolicyClient::decidePolicyForNavigationAction(const QUrl& url, const QUrl& originatingUrl, Qt::MouseButton mouseButton, Qt::KeyboardModifiers keyboardModifiers, WKFramePolicyListenerRef listener)
+void QtWebPagePolicyClient::decidePolicyForNavigationAction(const QUrl& url, const QUrl& originatingUrl, Qt::MouseButton mouseButton,
+ Qt::KeyboardModifiers keyboardModifiers, QQuickWebView::NavigationType navigationType, WKFramePolicyListenerRef listener)
{
// NOTE: even though the C API (and the WebKit2 IPC) supports an asynchronous answer, this is not currently working.
// We are expected to call the listener immediately. See the patch for https://bugs.webkit.org/show_bug.cgi?id=53785.
- QWebNavigationRequest navigationRequest(url, originatingUrl, mouseButton, keyboardModifiers);
+ QWebNavigationRequest navigationRequest(url, originatingUrl, mouseButton, keyboardModifiers, navigationType);
emit m_webView->navigationRequested(&navigationRequest);
switch (navigationRequest.action()) {
@@ -99,13 +99,33 @@ static Qt::KeyboardModifiers toQtKeyboardModifiers(WKEventModifiers modifiers)
return qtModifiers;
}
-void QtWebPagePolicyClient::decidePolicyForNavigationAction(WKPageRef, WKFrameRef frame, WKFrameNavigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKURLRequestRef request, WKFramePolicyListenerRef listener, WKTypeRef, const void* clientInfo)
+static QQuickWebView::NavigationType toQuickWebViewNavigationType(WKFrameNavigationType navigationType)
+{
+ switch (navigationType) {
+ case kWKFrameNavigationTypeLinkClicked:
+ return QQuickWebView::LinkClickedNavigation;
+ case kWKFrameNavigationTypeFormSubmitted:
+ return QQuickWebView::FormSubmittedNavigation;
+ case kWKFrameNavigationTypeBackForward:
+ return QQuickWebView::BackForwardNavigation;
+ case kWKFrameNavigationTypeReload:
+ return QQuickWebView::ReloadNavigation;
+ case kWKFrameNavigationTypeFormResubmitted:
+ return QQuickWebView::FormResubmittedNavigation;
+ case kWKFrameNavigationTypeOther:
+ return QQuickWebView::OtherNavigation;
+ }
+ ASSERT_NOT_REACHED();
+ return QQuickWebView::OtherNavigation;
+}
+
+void QtWebPagePolicyClient::decidePolicyForNavigationAction(WKPageRef, WKFrameRef frame, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKURLRequestRef request, WKFramePolicyListenerRef listener, WKTypeRef, const void* clientInfo)
{
WKRetainPtr<WKURLRef> frameURL(AdoptWK, WKFrameCopyURL(frame));
WKRetainPtr<WKURLRef> requestURL(AdoptWK, WKURLRequestCopyURL(request));
QUrl qUrlFrame = WKURLCopyQUrl(frameURL.get());
QUrl qUrl = WKURLCopyQUrl(requestURL.get());
- toQtWebPagePolicyClient(clientInfo)->decidePolicyForNavigationAction(qUrl, qUrlFrame, toQtMouseButton(mouseButton), toQtKeyboardModifiers(modifiers), listener);
+ toQtWebPagePolicyClient(clientInfo)->decidePolicyForNavigationAction(qUrl, qUrlFrame, toQtMouseButton(mouseButton), toQtKeyboardModifiers(modifiers), toQuickWebViewNavigationType(navigationType), listener);
}
void QtWebPagePolicyClient::decidePolicyForResponse(WKPageRef page, WKFrameRef frame, WKURLResponseRef response, WKURLRequestRef, WKFramePolicyListenerRef listener, WKTypeRef, const void*)
diff --git a/Source/WebKit2/UIProcess/qt/QtWebPagePolicyClient.h b/Source/WebKit2/UIProcess/qt/QtWebPagePolicyClient.h
index 8c6021398..e393d54f3 100644
--- a/Source/WebKit2/UIProcess/qt/QtWebPagePolicyClient.h
+++ b/Source/WebKit2/UIProcess/qt/QtWebPagePolicyClient.h
@@ -21,17 +21,17 @@
#ifndef QtWebPagePolicyClient_h
#define QtWebPagePolicyClient_h
+#include "qquickwebview_p.h"
#include <QtCore/QUrl>
#include <WKPage.h>
class QQuickWebView;
-
class QtWebPagePolicyClient {
public:
QtWebPagePolicyClient(WKPageRef, QQuickWebView*);
private:
- void decidePolicyForNavigationAction(const QUrl&, const QUrl&, Qt::MouseButton, Qt::KeyboardModifiers, WKFramePolicyListenerRef);
+ void decidePolicyForNavigationAction(const QUrl&, const QUrl&, Qt::MouseButton, Qt::KeyboardModifiers, QQuickWebView::NavigationType, WKFramePolicyListenerRef);
// WKPagePolicyClient callbacks.
static void decidePolicyForNavigationAction(WKPageRef, WKFrameRef, WKFrameNavigationType, WKEventModifiers, WKEventMouseButton, WKURLRequestRef, WKFramePolicyListenerRef, WKTypeRef userData, const void* clientInfo);
diff --git a/Source/WebKit2/UIProcess/win/WebPopupMenuProxyWin.cpp b/Source/WebKit2/UIProcess/win/WebPopupMenuProxyWin.cpp
index a040ad4aa..0c18c4e83 100644
--- a/Source/WebKit2/UIProcess/win/WebPopupMenuProxyWin.cpp
+++ b/Source/WebKit2/UIProcess/win/WebPopupMenuProxyWin.cpp
@@ -946,12 +946,12 @@ bool WebPopupMenuProxyWin::scrollToRevealSelection()
int index = focusedIndex();
if (index < m_scrollOffset) {
- ScrollableArea::scrollToYOffsetWithoutAnimation(index);
+ ScrollableArea::scrollToOffsetWithoutAnimation(VerticalScrollbar, index);
return true;
}
if (index >= m_scrollOffset + visibleItems()) {
- ScrollableArea::scrollToYOffsetWithoutAnimation(index - visibleItems() + 1);
+ ScrollableArea::scrollToOffsetWithoutAnimation(VerticalScrollbar, index - visibleItems() + 1);
return true;
}
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
index f40a24a2e..2267d66a9 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
+++ b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
@@ -128,6 +128,7 @@ void InjectedBundle::overrideBoolPreferenceForTestRunner(WebPageGroupProxy* page
#define FOR_EACH_OVERRIDE_BOOL_PREFERENCE(macro) \
macro(WebKitAcceleratedCompositingEnabled, AcceleratedCompositingEnabled, acceleratedCompositingEnabled) \
macro(WebKitCSSCustomFilterEnabled, CSSCustomFilterEnabled, cssCustomFilterEnabled) \
+ macro(WebKitCSSRegionsEnabled, CSSRegionsEnabled, cssRegionsEnabled) \
macro(WebKitJavaEnabled, JavaEnabled, javaEnabled) \
macro(WebKitJavaScriptEnabled, ScriptEnabled, javaScriptEnabled) \
macro(WebKitLoadSiteIconsKey, LoadsSiteIconsIgnoringImageLoadingSetting, loadsSiteIconsIgnoringImageLoadingPreference) \
diff --git a/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp b/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp
index 84b52c2ac..90a7f4021 100644
--- a/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp
+++ b/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -114,11 +114,7 @@ bool WebNotificationManager::show(Notification* notification, WebPage* page)
m_notificationMap.set(notification, notificationID);
m_notificationIDMap.set(notificationID, notification);
- NotificationContextMap::iterator it = m_notificationContextMap.find(notification->scriptExecutionContext());
- if (it == m_notificationContextMap.end()) {
- pair<NotificationContextMap::iterator, bool> addedPair = m_notificationContextMap.add(notification->scriptExecutionContext(), Vector<uint64_t>());
- it = addedPair.first;
- }
+ NotificationContextMap::iterator it = m_notificationContextMap.add(notification->scriptExecutionContext(), Vector<uint64_t>()).first;
it->second.append(notificationID);
m_process->connection()->send(Messages::WebPageProxy::ShowNotification(notification->contents().title, notification->contents().body, notification->iconURL().string(), notification->scriptExecutionContext()->securityOrigin()->toString(), notificationID), page->pageID());
@@ -149,7 +145,16 @@ void WebNotificationManager::clearNotifications(WebCore::ScriptExecutionContext*
if (it == m_notificationContextMap.end())
return;
- m_process->connection()->send(Messages::WebNotificationManagerProxy::ClearNotifications(it->second), page->pageID());
+ Vector<uint64_t>& notificationIDs = it->second;
+ m_process->connection()->send(Messages::WebNotificationManagerProxy::ClearNotifications(notificationIDs), page->pageID());
+ size_t count = notificationIDs.size();
+ for (size_t i = 0; i < count; ++i) {
+ RefPtr<Notification> notification = m_notificationIDMap.take(notificationIDs[i]);
+ if (!notification)
+ continue;
+ m_notificationMap.remove(notification);
+ }
+
m_notificationContextMap.remove(it);
#endif
}
@@ -161,7 +166,8 @@ void WebNotificationManager::didDestroyNotification(Notification* notification,
if (!notificationID)
return;
- m_notificationIDMap.take(notificationID);
+ m_notificationIDMap.remove(notificationID);
+ removeNotificationFromContextMap(notificationID, notification);
m_process->connection()->send(Messages::WebNotificationManagerProxy::DidDestroyNotification(notificationID), page->pageID());
#endif
}
@@ -203,19 +209,30 @@ void WebNotificationManager::didCloseNotifications(const Vector<uint64_t>& notif
if (!isNotificationIDValid(notificationID))
continue;
- RefPtr<Notification> notification = m_notificationIDMap.get(notificationID);
+ RefPtr<Notification> notification = m_notificationIDMap.take(notificationID);
if (!notification)
continue;
- NotificationContextMap::iterator it = m_notificationContextMap.find(notification->scriptExecutionContext());
- ASSERT(it != m_notificationContextMap.end());
- size_t index = it->second.find(notificationID);
- ASSERT(index != notFound);
- it->second.remove(index);
+ m_notificationMap.remove(notification);
+ removeNotificationFromContextMap(notificationID, notification.get());
notification->dispatchCloseEvent();
}
#endif
}
+#if ENABLE(NOTIFICATIONS)
+void WebNotificationManager::removeNotificationFromContextMap(uint64_t notificationID, Notification* notification)
+{
+ // This is a helper function for managing the hash maps.
+ NotificationContextMap::iterator it = m_notificationContextMap.find(notification->scriptExecutionContext());
+ ASSERT(it != m_notificationContextMap.end());
+ size_t index = it->second.find(notificationID);
+ ASSERT(index != notFound);
+ it->second.remove(index);
+ if (it->second.isEmpty())
+ m_notificationContextMap.remove(it);
+}
+#endif
+
} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.h b/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.h
index dc550e231..3b788be20 100644
--- a/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.h
+++ b/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -77,6 +77,10 @@ private:
void didCloseNotifications(const Vector<uint64_t>& notificationIDs);
void didUpdateNotificationDecision(const String& originString, bool allowed);
void didRemoveNotificationDecisions(const Vector<String>& originStrings);
+
+#if ENABLE(NOTIFICATIONS)
+ void removeNotificationFromContextMap(uint64_t notificationID, WebCore::Notification*);
+#endif
WebProcess* m_process;
diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp b/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp
index b4657f95f..01e73f95f 100644
--- a/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp
+++ b/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp
@@ -98,11 +98,11 @@ JSObject* NPRuntimeObjectMap::getOrCreateJSObject(JSGlobalObject* globalObject,
if (NPJSObject::isNPJSObject(npObject))
return NPJSObject::toNPJSObject(npObject)->jsObject();
- if (JSC::Weak<JSNPObject> jsNPObject = m_jsNPObjects.get(npObject))
- return jsNPObject.get();
+ if (JSNPObject* jsNPObject = m_jsNPObjects.get(npObject))
+ return jsNPObject;
JSNPObject* jsNPObject = JSNPObject::create(globalObject, this, npObject);
- m_jsNPObjects.set(npObject, JSC::Weak<JSNPObject>(globalObject->globalData(), jsNPObject, this, npObject));
+ m_jsNPObjects.set(npObject, JSC::PassWeak<JSNPObject>(globalObject->globalData(), jsNPObject, this, npObject));
return jsNPObject;
}
diff --git a/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.h b/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.h
index c185c1871..d6c364f00 100644
--- a/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.h
+++ b/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.h
@@ -140,7 +140,6 @@ private:
virtual bool isOnActivePage() const;
virtual bool shouldSuspendScrollAnimations() const { return false; } // If we return true, ScrollAnimatorMac will keep cycling a timer forever, waiting for a good time to animate.
virtual void scrollbarStyleChanged(int newStyle, bool forceUpdate);
- virtual void zoomAnimatorTransformChanged(float, float, float, ZoomAnimationState) { }
// FIXME: Implement the other conversion functions; this one is enough to get scrollbar hit testing working.
virtual WebCore::IntPoint convertFromContainingViewToScrollbar(const WebCore::Scrollbar*, const WebCore::IntPoint& parentPoint) const;
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
index dd68e1f9b..9761c154a 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
@@ -220,6 +220,7 @@ private:
virtual bool shouldRubberBandInDirection(WebCore::ScrollDirection) const OVERRIDE;
virtual void numWheelEventHandlersChanged(unsigned) OVERRIDE;
+ virtual void numTouchEventHandlersChanged(unsigned) OVERRIDE { }
String m_cachedToolTip;
mutable RefPtr<WebFrame> m_cachedFrameSetLargestFrame;
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.h b/Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.h
index 913eb6e56..a9411ac40 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.h
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.h
@@ -53,7 +53,7 @@ private:
virtual void startDrag(WebCore::DragImageRef, const WebCore::IntPoint& dragImageOrigin, const WebCore::IntPoint& eventPos, WebCore::Clipboard*, WebCore::Frame*, bool linkDrag = false) OVERRIDE;
#if PLATFORM(MAC)
- virtual void declareAndWriteDragImage(NSPasteboard*, DOMElement*, NSURL*, NSString*, WebCore::Frame*) OVERRIDE;
+ virtual void declareAndWriteDragImage(const String& pasteboardName, DOMElement*, NSURL*, NSString*, WebCore::Frame*) OVERRIDE;
#endif
virtual void dragEnded() OVERRIDE;
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
index f22b26074..c74216786 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
@@ -148,9 +148,9 @@ bool WebEditorClient::shouldChangeSelectedRange(Range* fromRange, Range* toRange
return result;
}
-bool WebEditorClient::shouldApplyStyle(CSSStyleDeclaration* style, Range* range)
+bool WebEditorClient::shouldApplyStyle(StylePropertySet* style, Range* range)
{
- bool result = m_page->injectedBundleEditorClient().shouldApplyStyle(m_page, style, range);
+ bool result = m_page->injectedBundleEditorClient().shouldApplyStyle(m_page, style->ensureCSSStyleDeclaration(), range);
notImplemented();
return result;
}
@@ -447,7 +447,7 @@ void WebEditorClient::setInputMethodState(bool)
notImplemented();
}
-void WebEditorClient::requestCheckingOfString(WebCore::SpellChecker*, int, WebCore::TextCheckingTypeMask, const WTF::String&)
+void WebEditorClient::requestCheckingOfString(WebCore::SpellChecker*, const WebCore::TextCheckingRequest&)
{
notImplemented();
}
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h b/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h
index 8f262205b..2fb3150bd 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h
@@ -59,7 +59,7 @@ private:
virtual bool shouldInsertText(const String&, WebCore::Range*, WebCore::EditorInsertAction) OVERRIDE;
virtual bool shouldChangeSelectedRange(WebCore::Range* fromRange, WebCore::Range* toRange, WebCore::EAffinity, bool stillSelecting) OVERRIDE;
- virtual bool shouldApplyStyle(WebCore::CSSStyleDeclaration*, WebCore::Range*) OVERRIDE;
+ virtual bool shouldApplyStyle(WebCore::StylePropertySet*, WebCore::Range*) OVERRIDE;
virtual bool shouldMoveRangeAfterDelete(WebCore::Range*, WebCore::Range*) OVERRIDE;
virtual void didBeginEditing() OVERRIDE;
@@ -141,7 +141,7 @@ private:
virtual void getGuessesForWord(const String& word, const String& context, Vector<String>& guesses) OVERRIDE;
virtual void willSetInputMethodState() OVERRIDE;
virtual void setInputMethodState(bool enabled) OVERRIDE;
- virtual void requestCheckingOfString(WebCore::SpellChecker*, int, WebCore::TextCheckingTypeMask, const WTF::String&) OVERRIDE;
+ virtual void requestCheckingOfString(WebCore::SpellChecker*, const WebCore::TextCheckingRequest&) OVERRIDE;
#if PLATFORM(MAC) && !defined(BUILDING_ON_SNOW_LEOPARD)
virtual void showCorrectionPanel(WebCore::CorrectionPanelInfo::PanelType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings) OVERRIDE;
virtual void dismissCorrectionPanel(WebCore::ReasonForDismissingCorrectionPanel) OVERRIDE;
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
index be24684db..49d3b84c4 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
@@ -537,7 +537,7 @@ void WebFrameLoaderClient::dispatchDidFirstLayout()
// Notify the UIProcess.
webPage->send(Messages::WebPageProxy::DidFirstLayoutForFrame(m_frame->frameID(), InjectedBundleUserMessageEncoder(userData.get())));
- if (m_frame == m_frame->page()->mainWebFrame() && !webPage->corePage()->settings()->suppressIncrementalRendering())
+ if (m_frame == m_frame->page()->mainWebFrame() && !webPage->corePage()->settings()->suppressesIncrementalRendering())
webPage->drawingArea()->setLayerTreeStateIsFrozen(false);
}
@@ -932,6 +932,11 @@ bool WebFrameLoaderClient::shouldGoToHistoryItem(HistoryItem* item) const
return false;
}
+ if (webPage->willGoToBackForwardItemCallbackEnabled()) {
+ webPage->send(Messages::WebPageProxy::WillGoToBackForwardListItem(itemID));
+ return true;
+ }
+
bool shouldGoToBackForwardListItem;
if (!webPage->sendSync(Messages::WebPageProxy::ShouldGoToBackForwardListItem(itemID), Messages::WebPageProxy::ShouldGoToBackForwardListItem::Reply(shouldGoToBackForwardListItem)))
return false;
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.cpp
index 14b86aea4..8fd108ad2 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.cpp
@@ -87,12 +87,10 @@ WebGraphicsLayer::WebGraphicsLayer(GraphicsLayerClient* client)
, m_hasPendingAnimations(false)
, m_inUpdateMode(false)
#if USE(TILED_BACKING_STORE)
- , m_layerTreeTileClient(0)
- , m_mainBackingStore(adoptPtr(new TiledBackingStore(this, TiledBackingStoreRemoteTileBackend::create(this))))
+ , m_webGraphicsLayerClient(0)
, m_contentsScale(1.f)
#endif
{
- m_mainBackingStore->setContentsScale(1.0);
static WebLayerID nextLayerID = 1;
m_layerInfo.id = nextLayerID++;
layerByIDMap().add(id(), this);
@@ -102,11 +100,10 @@ WebGraphicsLayer::~WebGraphicsLayer()
{
layerByIDMap().remove(id());
- // This would tell the UI process to release the backing store.
- setContentsToImage(0);
-
- if (m_layerTreeTileClient)
- m_layerTreeTileClient->didDeleteLayer(id());
+ if (m_webGraphicsLayerClient) {
+ purgeBackingStores();
+ m_webGraphicsLayerClient->detachLayer(this);
+ }
}
bool WebGraphicsLayer::setChildren(const Vector<GraphicsLayer*>& children)
@@ -116,7 +113,7 @@ bool WebGraphicsLayer::setChildren(const Vector<GraphicsLayer*>& children)
return false;
for (int i = 0; i < children.size(); ++i) {
WebGraphicsLayer* child = toWebGraphicsLayer(children[i]);
- child->setVisibleContentRectAndScale(m_pageVisibleRect, m_contentsScale);
+ child->setWebGraphicsLayerClient(m_webGraphicsLayerClient);
child->notifyChange();
}
notifyChange();
@@ -126,7 +123,7 @@ bool WebGraphicsLayer::setChildren(const Vector<GraphicsLayer*>& children)
void WebGraphicsLayer::addChild(GraphicsLayer* layer)
{
GraphicsLayer::addChild(layer);
- toWebGraphicsLayer(layer)->setVisibleContentRectAndScale(m_pageVisibleRect, m_contentsScale);
+ toWebGraphicsLayer(layer)->setWebGraphicsLayerClient(m_webGraphicsLayerClient);
toWebGraphicsLayer(layer)->notifyChange();
notifyChange();
}
@@ -134,7 +131,7 @@ void WebGraphicsLayer::addChild(GraphicsLayer* layer)
void WebGraphicsLayer::addChildAtIndex(GraphicsLayer* layer, int index)
{
GraphicsLayer::addChildAtIndex(layer, index);
- toWebGraphicsLayer(layer)->setVisibleContentRectAndScale(m_pageVisibleRect, m_contentsScale);
+ toWebGraphicsLayer(layer)->setWebGraphicsLayerClient(m_webGraphicsLayerClient);
toWebGraphicsLayer(layer)->notifyChange();
notifyChange();
}
@@ -142,7 +139,7 @@ void WebGraphicsLayer::addChildAtIndex(GraphicsLayer* layer, int index)
void WebGraphicsLayer::addChildAbove(GraphicsLayer* layer, GraphicsLayer* sibling)
{
GraphicsLayer::addChildAbove(layer, sibling);
- toWebGraphicsLayer(layer)->setVisibleContentRectAndScale(m_pageVisibleRect, m_contentsScale);
+ toWebGraphicsLayer(layer)->setWebGraphicsLayerClient(m_webGraphicsLayerClient);
toWebGraphicsLayer(layer)->notifyChange();
notifyChange();
}
@@ -150,7 +147,7 @@ void WebGraphicsLayer::addChildAbove(GraphicsLayer* layer, GraphicsLayer* siblin
void WebGraphicsLayer::addChildBelow(GraphicsLayer* layer, GraphicsLayer* sibling)
{
GraphicsLayer::addChildBelow(layer, sibling);
- toWebGraphicsLayer(layer)->setVisibleContentRectAndScale(m_pageVisibleRect, m_contentsScale);
+ toWebGraphicsLayer(layer)->setWebGraphicsLayerClient(m_webGraphicsLayerClient);
toWebGraphicsLayer(layer)->notifyChange();
notifyChange();
}
@@ -162,8 +159,7 @@ bool WebGraphicsLayer::replaceChild(GraphicsLayer* oldChild, GraphicsLayer* newC
return false;
notifyChange();
toWebGraphicsLayer(oldChild)->notifyChange();
- toWebGraphicsLayer(oldChild)->setLayerTreeTileClient(0);
- toWebGraphicsLayer(newChild)->setVisibleContentRectAndScale(m_pageVisibleRect, m_contentsScale);
+ toWebGraphicsLayer(newChild)->setWebGraphicsLayerClient(m_webGraphicsLayerClient);
toWebGraphicsLayer(newChild)->notifyChange();
return true;
}
@@ -175,7 +171,6 @@ void WebGraphicsLayer::removeFromParent()
GraphicsLayer::removeFromParent();
notifyChange();
- setLayerTreeTileClient(0);
}
void WebGraphicsLayer::setPosition(const FloatPoint& p)
@@ -249,8 +244,6 @@ void WebGraphicsLayer::setDrawsContent(bool b)
return;
GraphicsLayer::setDrawsContent(b);
- if (b)
- setNeedsDisplay();
notifyChange();
}
@@ -258,6 +251,8 @@ void WebGraphicsLayer::setContentsOpaque(bool b)
{
if (contentsOpaque() == b)
return;
+ if (m_mainBackingStore)
+ m_mainBackingStore->setSupportsAlpha(!b);
GraphicsLayer::setContentsOpaque(b);
notifyChange();
}
@@ -347,17 +342,16 @@ void WebGraphicsLayer::setContentsToImage(Image* image)
{
if (image == m_image)
return;
- WebLayerTreeTileClient* client = layerTreeTileClient();
int64_t newID = 0;
- if (client) {
+ if (m_webGraphicsLayerClient) {
// We adopt first, in case this is the same frame - that way we avoid destroying and recreating the image.
- newID = client->adoptImageBackingStore(image);
- client->releaseImageBackingStore(m_layerInfo.imageBackingStoreID);
+ newID = m_webGraphicsLayerClient->adoptImageBackingStore(image);
+ m_webGraphicsLayerClient->releaseImageBackingStore(m_layerInfo.imageBackingStoreID);
notifyChange();
if (m_layerInfo.imageBackingStoreID && newID == m_layerInfo.imageBackingStoreID)
return;
} else {
- // If client not set yet there should be no backing store ID.
+ // If m_webGraphicsLayerClient is not set yet there should be no backing store ID.
ASSERT(!m_layerInfo.imageBackingStoreID);
notifyChange();
}
@@ -380,9 +374,8 @@ void WebGraphicsLayer::setMaskLayer(GraphicsLayer* layer)
layer->setSize(size());
WebGraphicsLayer* webGraphicsLayer = toWebGraphicsLayer(layer);
- webGraphicsLayer->setLayerTreeTileClient(layerTreeTileClient());
+ webGraphicsLayer->setWebGraphicsLayerClient(m_webGraphicsLayerClient);
webGraphicsLayer->setMaskTarget(this);
- webGraphicsLayer->setVisibleContentRectAndScale(m_pageVisibleRect, m_contentsScale);
webGraphicsLayer->notifyChange();
notifyChange();
@@ -394,7 +387,7 @@ void WebGraphicsLayer::setReplicatedByLayer(GraphicsLayer* layer)
return;
if (layer)
- toWebGraphicsLayer(layer)->setLayerTreeTileClient(layerTreeTileClient());
+ toWebGraphicsLayer(layer)->setWebGraphicsLayerClient(m_webGraphicsLayerClient);
GraphicsLayer::setReplicatedByLayer(layer);
notifyChange();
@@ -407,8 +400,8 @@ void WebGraphicsLayer::setNeedsDisplay()
void WebGraphicsLayer::setNeedsDisplayInRect(const FloatRect& rect)
{
- recreateBackingStoreIfNeeded();
- m_mainBackingStore->invalidate(IntRect(rect));
+ if (m_mainBackingStore)
+ m_mainBackingStore->invalidate(IntRect(rect));
notifyChange();
}
@@ -438,9 +431,6 @@ WebGraphicsLayer* toWebGraphicsLayer(GraphicsLayer* layer)
void WebGraphicsLayer::syncCompositingStateForThisLayerOnly()
{
- if (!m_layerTreeTileClient)
- m_layerTreeTileClient = layerTreeTileClient();
-
updateContentBuffers();
if (!m_modified)
@@ -469,11 +459,7 @@ void WebGraphicsLayer::syncCompositingStateForThisLayerOnly()
for (size_t i = 0; i < children().size(); ++i)
m_layerInfo.children.append(toWebLayerID(children()[i]));
- ASSERT(m_layerTreeTileClient);
- if (m_layerInfo.imageIsUpdated && m_image && !m_layerInfo.imageBackingStoreID)
- m_layerInfo.imageBackingStoreID = m_layerTreeTileClient->adoptImageBackingStore(m_image.get());
-
- m_layerTreeTileClient->didSyncCompositingStateForLayer(m_layerInfo);
+ m_webGraphicsLayerClient->didSyncCompositingStateForLayer(m_layerInfo);
m_modified = false;
m_layerInfo.imageIsUpdated = false;
if (m_hasPendingAnimations)
@@ -495,28 +481,34 @@ void WebGraphicsLayer::setRootLayer(bool isRoot)
void WebGraphicsLayer::setVisibleContentRectTrajectoryVector(const FloatPoint& trajectoryVector)
{
- m_mainBackingStore->setVisibleRectTrajectoryVector(trajectoryVector);
+ if (m_mainBackingStore)
+ m_mainBackingStore->coverWithTilesIfNeeded(trajectoryVector);
}
-void WebGraphicsLayer::setVisibleContentRectAndScale(const IntRect& pageVisibleRect, float scale)
+void WebGraphicsLayer::setContentsScale(float scale)
{
- if (m_pageVisibleRect == pageVisibleRect && m_contentsScale == scale)
+ m_contentsScale = scale;
+
+ if (!m_mainBackingStore || m_mainBackingStore->contentsScale() == scale)
return;
- m_pageVisibleRect = pageVisibleRect;
- m_contentsScale = scale;
+ // Between creating the new backing store and painting the content,
+ // we do not want to drop the previous one as that might result in
+ // briefly seeing flickering as the old tiles may be dropped before
+ // something replaces them.
+ m_previousBackingStore = m_mainBackingStore.release();
- if (!m_mainBackingStore || m_mainBackingStore->contentsScale() != scale) {
- m_previousBackingStore = m_mainBackingStore.release();
- m_mainBackingStore = adoptPtr(new TiledBackingStore(this, TiledBackingStoreRemoteTileBackend::create(this)));
- m_mainBackingStore->setContentsScale(scale);
- } else
- m_mainBackingStore->adjustVisibleRect();
+ // No reason to save the previous backing store for non-visible areas.
+ m_previousBackingStore->removeAllNonVisibleTiles();
- if (maskLayer())
- toWebGraphicsLayer(maskLayer())->setVisibleContentRectAndScale(pageVisibleRect, scale);
- for (size_t i = 0; i < children().size(); ++i)
- toWebGraphicsLayer(children()[i])->setVisibleContentRectAndScale(pageVisibleRect, scale);
+ createBackingStore();
+}
+
+void WebGraphicsLayer::createBackingStore()
+{
+ m_mainBackingStore = adoptPtr(new TiledBackingStore(this, TiledBackingStoreRemoteTileBackend::create(this)));
+ m_mainBackingStore->setSupportsAlpha(!contentsOpaque());
+ m_mainBackingStore->setContentsScale(m_contentsScale);
}
void WebGraphicsLayer::tiledBackingStorePaint(GraphicsContext* context, const IntRect& rect)
@@ -535,15 +527,11 @@ bool WebGraphicsLayer::tiledBackingStoreUpdatesAllowed() const
{
if (!m_inUpdateMode)
return false;
- if (WebLayerTreeTileClient* client = layerTreeTileClient())
- return client->layerTreeTileUpdatesAllowed();
- return false;
+ return m_webGraphicsLayerClient->layerTreeTileUpdatesAllowed();
}
IntRect WebGraphicsLayer::tiledBackingStoreContentsRect()
{
- if (!drawsContent())
- return IntRect();
return IntRect(0, 0, size().width(), size().height());
}
@@ -561,7 +549,7 @@ IntRect WebGraphicsLayer::tiledBackingStoreVisibleRect()
// Return a projection of the visible rect (surface coordinates) onto the layer's plane (layer coordinates).
// The resulting quad might be squewed and the visible rect is the bounding box of this quad,
// so it might spread further than the real visible area (and then even more amplified by the cover rect multiplier).
- return m_layerTransform.combined().inverse().clampedBoundsOfProjectedQuad(FloatQuad(FloatRect(m_pageVisibleRect)));
+ return m_layerTransform.combined().inverse().clampedBoundsOfProjectedQuad(FloatQuad(FloatRect(m_webGraphicsLayerClient->visibleContentsRect())));
}
Color WebGraphicsLayer::tiledBackingStoreBackgroundColor() const
@@ -572,125 +560,91 @@ Color WebGraphicsLayer::tiledBackingStoreBackgroundColor() const
void WebGraphicsLayer::createTile(int tileID, const UpdateInfo& updateInfo)
{
m_modified = true;
- if (WebLayerTreeTileClient* client = layerTreeTileClient())
- client->createTile(id(), tileID, updateInfo);
+ m_webGraphicsLayerClient->createTile(id(), tileID, updateInfo);
}
void WebGraphicsLayer::updateTile(int tileID, const UpdateInfo& updateInfo)
{
m_modified = true;
- if (WebLayerTreeTileClient* client = layerTreeTileClient())
- client->updateTile(id(), tileID, updateInfo);
+ m_webGraphicsLayerClient->updateTile(id(), tileID, updateInfo);
}
void WebGraphicsLayer::removeTile(int tileID)
{
m_modified = true;
- if (WebLayerTreeTileClient* client = layerTreeTileClient())
- client->removeTile(id(), tileID);
+ m_webGraphicsLayerClient->removeTile(id(), tileID);
}
-void WebGraphicsLayer::updateTileBuffersRecursively()
+void WebGraphicsLayer::updateContentBuffers()
{
- m_mainBackingStore->updateTileBuffers();
- for (size_t i = 0; i < children().size(); ++i) {
- WebGraphicsLayer* layer = toWebGraphicsLayer(this->children()[i]);
- layer->updateTileBuffersRecursively();
+ // The remote image might have been released by purgeBackingStores.
+ if (m_image) {
+ if (!m_layerInfo.imageBackingStoreID) {
+ m_layerInfo.imageBackingStoreID = m_webGraphicsLayerClient->adoptImageBackingStore(m_image.get());
+ m_layerInfo.imageIsUpdated = true;
+ }
}
- if (WebGraphicsLayer* mask = toWebGraphicsLayer(maskLayer()))
- mask->updateTileBuffersRecursively();
-}
-
-WebLayerTreeTileClient* WebGraphicsLayer::layerTreeTileClient() const
-{
- if (m_layerTreeTileClient)
- return m_layerTreeTileClient;
- WebGraphicsLayer* parent;
- if (this->replicatedLayer())
- parent = toWebGraphicsLayer(this->replicatedLayer());
- else if (this->maskTarget())
- parent = toWebGraphicsLayer(this->maskTarget());
- else
- parent = toWebGraphicsLayer(this->parent());
-
- if (!parent)
- return 0;
- return parent->layerTreeTileClient();
-}
-
-void WebGraphicsLayer::updateContentBuffers()
-{
- // Backing-stores for directly composited images is handled in LayerTreeHost.
- if (m_image)
+ if (!drawsContent()) {
+ m_mainBackingStore.clear();
+ m_previousBackingStore.clear();
return;
+ }
- if (!drawsContent())
- return;
- WebLayerTreeTileClient* client = layerTreeTileClient();
- if (!client)
- return;
m_inUpdateMode = true;
+ // This is the only place we (re)create the main tiled backing store, once we
+ // have a remote client and we are ready to send our data to the UI process.
+ if (!m_mainBackingStore)
+ createBackingStore();
m_mainBackingStore->updateTileBuffers();
m_inUpdateMode = false;
-}
-
-void WebGraphicsLayer::purgeBackingStores()
-{
- for (size_t i = 0; i < children().size(); ++i) {
- WebGraphicsLayer* layer = toWebGraphicsLayer(this->children()[i]);
- layer->purgeBackingStores();
- }
- if (WebGraphicsLayer* mask = toWebGraphicsLayer(maskLayer()))
- mask->purgeBackingStores();
-
- if (m_mainBackingStore)
- m_mainBackingStore.clear();
-
- if (!m_layerInfo.imageBackingStoreID)
- return;
-
- layerTreeTileClient()->releaseImageBackingStore(m_layerInfo.imageBackingStoreID);
- m_layerInfo.imageBackingStoreID = 0;
+ // The previous backing store is kept around to avoid flickering between
+ // removing the existing tiles and painting the new ones. The first time
+ // the visibleRect is full painted we remove the previous backing store.
+ if (m_mainBackingStore->visibleAreaIsCovered())
+ m_previousBackingStore.clear();
}
-void WebGraphicsLayer::recreateBackingStoreIfNeeded()
+void WebGraphicsLayer::purgeBackingStores()
{
- for (size_t i = 0; i < children().size(); ++i) {
- WebGraphicsLayer* layer = toWebGraphicsLayer(this->children()[i]);
- layer->recreateBackingStoreIfNeeded();
- }
- if (WebGraphicsLayer* mask = toWebGraphicsLayer(maskLayer()))
- mask->recreateBackingStoreIfNeeded();
+ m_mainBackingStore.clear();
+ m_previousBackingStore.clear();
- if (!m_mainBackingStore) {
- m_mainBackingStore = adoptPtr(new TiledBackingStore(this, TiledBackingStoreRemoteTileBackend::create(this)));
- m_mainBackingStore->setContentsScale(m_contentsScale);
+ if (m_layerInfo.imageBackingStoreID) {
+ m_webGraphicsLayerClient->releaseImageBackingStore(m_layerInfo.imageBackingStoreID);
+ m_layerInfo.imageBackingStoreID = 0;
}
-
- if (m_image)
- setContentsNeedsDisplay();
}
-void WebGraphicsLayer::setLayerTreeTileClient(WebKit::WebLayerTreeTileClient* client)
+void WebGraphicsLayer::setWebGraphicsLayerClient(WebKit::WebGraphicsLayerClient* client)
{
- if (m_layerTreeTileClient == client)
+ if (m_webGraphicsLayerClient == client)
return;
if (WebGraphicsLayer* replica = toWebGraphicsLayer(replicaLayer()))
- replica->setLayerTreeTileClient(client);
+ replica->setWebGraphicsLayerClient(client);
if (WebGraphicsLayer* mask = toWebGraphicsLayer(maskLayer()))
- mask->setLayerTreeTileClient(client);
+ mask->setWebGraphicsLayerClient(client);
for (size_t i = 0; i < children().size(); ++i) {
WebGraphicsLayer* layer = toWebGraphicsLayer(this->children()[i]);
- layer->setLayerTreeTileClient(client);
+ layer->setWebGraphicsLayerClient(client);
}
- // Have to force detach from remote layer here if layer tile client changes.
- if (m_layerTreeTileClient)
- m_layerTreeTileClient->didDeleteLayer(id());
- m_layerTreeTileClient = client;
+ // We have to release resources on the UI process here if the remote client has changed or is removed.
+ if (m_webGraphicsLayerClient) {
+ purgeBackingStores();
+ m_webGraphicsLayerClient->detachLayer(this);
+ }
+ m_webGraphicsLayerClient = client;
+ if (client)
+ client->attachLayer(this);
+}
+
+void WebGraphicsLayer::adjustVisibleRect()
+{
+ if (m_mainBackingStore)
+ m_mainBackingStore->coverWithTilesIfNeeded();
}
void WebGraphicsLayer::computeTransformedVisibleRect()
@@ -703,8 +657,9 @@ void WebGraphicsLayer::computeTransformedVisibleRect()
m_layerTransform.setFlattening(!preserves3D());
m_layerTransform.setChildrenTransform(childrenTransform());
m_layerTransform.combineTransforms(parent() ? toWebGraphicsLayer(parent())->m_layerTransform.combinedForChildren() : TransformationMatrix());
+
// The combined transform will be used in tiledBackingStoreVisibleRect.
- m_mainBackingStore->adjustVisibleRect();
+ adjustVisibleRect();
}
#endif
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.h b/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.h
index 0b50763b7..4096d3764 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.h
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.h
@@ -39,19 +39,26 @@
#if USE(ACCELERATED_COMPOSITING)
+namespace WebCore {
+class WebGraphicsLayer;
+}
+
namespace WebKit {
-class WebLayerTreeTileClient {
+class WebGraphicsLayerClient {
public:
// TiledBackingStoreRemoteTileClient
virtual void createTile(WebLayerID, int tileID, const UpdateInfo&) = 0;
virtual void updateTile(WebLayerID, int tileID, const UpdateInfo&) = 0;
virtual void removeTile(WebLayerID, int tileID) = 0;
+
+ virtual WebCore::IntRect visibleContentsRect() const = 0;
virtual bool layerTreeTileUpdatesAllowed() const = 0;
virtual int64_t adoptImageBackingStore(WebCore::Image*) = 0;
virtual void releaseImageBackingStore(int64_t) = 0;
virtual void didSyncCompositingStateForLayer(const WebLayerInfo&) = 0;
- virtual void didDeleteLayer(WebLayerID) = 0;
+ virtual void attachLayer(WebCore::WebGraphicsLayer*) = 0;
+ virtual void detachLayer(WebCore::WebGraphicsLayer*) = 0;
};
}
@@ -96,7 +103,7 @@ public:
void setNeedsDisplay();
void setNeedsDisplayInRect(const FloatRect&);
void setContentsNeedsDisplay();
- void setVisibleContentRectAndScale(const IntRect&, float scale);
+ void setContentsScale(float);
void setVisibleContentRectTrajectoryVector(const FloatPoint&);
virtual void syncCompositingState(const FloatRect&);
virtual void syncCompositingStateForThisLayerOnly();
@@ -129,14 +136,12 @@ public:
virtual void updateTile(int tileID, const WebKit::UpdateInfo&);
virtual void removeTile(int tileID);
- void setLayerTreeTileClient(WebKit::WebLayerTreeTileClient*);
- WebKit::WebLayerTreeTileClient* layerTreeTileClient() const;
+ void setWebGraphicsLayerClient(WebKit::WebGraphicsLayerClient*);
+ void adjustVisibleRect();
bool isReadyForTileBufferSwap() const;
- void updateTileBuffersRecursively();
void updateContentBuffers();
void purgeBackingStores();
- void recreateBackingStoreIfNeeded();
#endif
private:
@@ -144,7 +149,6 @@ private:
RefPtr<Image> m_image;
GraphicsLayer* m_maskTarget;
FloatRect m_needsDisplayRect;
- IntRect m_pageVisibleRect;
LayerTransform m_layerTransform;
bool m_needsDisplay : 1;
bool m_modified : 1;
@@ -154,6 +158,7 @@ private:
void notifyChange();
void notifyChangeRecursively();
+ void createBackingStore();
HashSet<String> m_transformAnimations;
bool selfOrAncestorHasActiveTransformAnimations() const;
@@ -161,7 +166,7 @@ private:
#if USE(TILED_BACKING_STORE)
void computeTransformedVisibleRect();
- WebKit::WebLayerTreeTileClient* m_layerTreeTileClient;
+ WebKit::WebGraphicsLayerClient* m_webGraphicsLayerClient;
OwnPtr<WebCore::TiledBackingStore> m_mainBackingStore;
OwnPtr<WebCore::TiledBackingStore> m_previousBackingStore;
float m_contentsScale;
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
index 65240ee84..138b3eb63 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
@@ -33,7 +33,9 @@
#include "WebCookieManager.h"
#include "WebCoreArgumentCoders.h"
#include "WebProcess.h"
+#include <WebCore/Color.h>
#include <WebCore/Page.h>
+#include <WebCore/PlatformPasteboard.h>
#if USE(CF)
#include <wtf/RetainPtr.h>
@@ -70,6 +72,11 @@ VisitedLinkStrategy* WebPlatformStrategies::createVisitedLinkStrategy()
return this;
}
+PasteboardStrategy* WebPlatformStrategies::createPasteboardStrategy()
+{
+ return this;
+}
+
// CookiesStrategy
void WebPlatformStrategies::notifyCookiesChanged()
@@ -125,6 +132,70 @@ void WebPlatformStrategies::addVisitedLink(Page*, LinkHash linkHash)
WebProcess::shared().addVisitedLink(linkHash);
}
+#if PLATFORM(MAC)
+// PasteboardStrategy
+
+void WebPlatformStrategies::getTypes(Vector<String>& types, const String& pasteboardName)
+{
+ PlatformPasteboard(pasteboardName).getTypes(types);
+}
+
+PassRefPtr<WebCore::SharedBuffer> WebPlatformStrategies::bufferForType(const String& pasteboardType, const String& pasteboardName)
+{
+ return PlatformPasteboard(pasteboardName).bufferForType(pasteboardType);
+}
+
+void WebPlatformStrategies::getPathnamesForType(Vector<String>& pathnames, const String& pasteboardType, const String& pasteboardName)
+{
+ PlatformPasteboard(pasteboardName).getPathnamesForType(pathnames, pasteboardType);
+}
+
+String WebPlatformStrategies::stringForType(const String& pasteboardType, const String& pasteboardName)
+{
+ return PlatformPasteboard(pasteboardName).stringForType(pasteboardType);
+}
+
+void WebPlatformStrategies::copy(const String& fromPasteboard, const String& toPasteboard)
+{
+ PlatformPasteboard(toPasteboard).copy(fromPasteboard);
+}
+
+int WebPlatformStrategies::changeCount(const WTF::String &pasteboardName)
+{
+ return PlatformPasteboard(pasteboardName).changeCount();
+}
+
+String WebPlatformStrategies::uniqueName()
+{
+ return PlatformPasteboard::uniqueName();
+}
+
+Color WebPlatformStrategies::color(const String& pasteboardName)
+{
+ return PlatformPasteboard(pasteboardName).color();
+}
+
+void WebPlatformStrategies::setTypes(const Vector<String>& pasteboardTypes, const String& pasteboardName)
+{
+ PlatformPasteboard(pasteboardName).setTypes(pasteboardTypes);
+}
+
+void WebPlatformStrategies::setBufferForType(PassRefPtr<SharedBuffer> buffer, const String& pasteboardType, const String& pasteboardName)
+{
+ PlatformPasteboard(pasteboardName).setBufferForType(buffer, pasteboardType);
+}
+
+void WebPlatformStrategies::setPathnamesForType(const Vector<String>& pathnames, const String& pasteboardType, const String& pasteboardName)
+{
+ PlatformPasteboard(pasteboardName).setPathnamesForType(pathnames, pasteboardType);
+}
+
+void WebPlatformStrategies::setStringForType(const String& string, const String& pasteboardType, const String& pasteboardName)
+{
+ PlatformPasteboard(pasteboardName).setStringForType(string, pasteboardType);
+}
+#endif
+
} // namespace WebKit
#endif // USE(PLATFORM_STRATEGIES)
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h b/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h
index 970f7ce6d..e8e9bf790 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h
@@ -29,13 +29,14 @@
#if USE(PLATFORM_STRATEGIES)
#include <WebCore/CookiesStrategy.h>
+#include <WebCore/PasteboardStrategy.h>
#include <WebCore/PlatformStrategies.h>
#include <WebCore/PluginStrategy.h>
#include <WebCore/VisitedLinkStrategy.h>
namespace WebKit {
-class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::PluginStrategy, private WebCore::VisitedLinkStrategy {
+class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::PluginStrategy, private WebCore::VisitedLinkStrategy, private WebCore::PasteboardStrategy {
public:
static void initialize();
@@ -46,6 +47,7 @@ private:
virtual WebCore::CookiesStrategy* createCookiesStrategy() OVERRIDE;
virtual WebCore::PluginStrategy* createPluginStrategy() OVERRIDE;
virtual WebCore::VisitedLinkStrategy* createVisitedLinkStrategy() OVERRIDE;
+ virtual WebCore::PasteboardStrategy* createPasteboardStrategy() OVERRIDE;
// WebCore::CookiesStrategy
virtual void notifyCookiesChanged() OVERRIDE;
@@ -59,6 +61,23 @@ private:
virtual bool isLinkVisited(WebCore::Page*, WebCore::LinkHash, const WebCore::KURL& baseURL, const WTF::AtomicString& attributeURL) OVERRIDE;
virtual void addVisitedLink(WebCore::Page*, WebCore::LinkHash) OVERRIDE;
+#if PLATFORM(MAC)
+ // WebCore::PasteboardStrategy
+ virtual void getTypes(Vector<String>& types, const String& pasteboardName) OVERRIDE;
+ virtual PassRefPtr<WebCore::SharedBuffer> bufferForType(const String& pasteboardType, const String& pasteboardName) OVERRIDE;
+ virtual void getPathnamesForType(Vector<String>& pathnames, const String& pasteboardType, const String& pasteboardName) OVERRIDE;
+ virtual String stringForType(const String& pasteboardType, const String& pasteboardName) OVERRIDE;
+ virtual int changeCount(const String& pasteboardName) OVERRIDE;
+ virtual String uniqueName() OVERRIDE;
+ virtual WebCore::Color color(const String& pasteboardName) OVERRIDE;
+
+ virtual void copy(const String& fromPasteboard, const String& toPasteboard) OVERRIDE;
+ virtual void setTypes(const Vector<String>& pasteboardTypes, const String& pasteboardName) OVERRIDE;
+ virtual void setBufferForType(PassRefPtr<WebCore::SharedBuffer>, const String& pasteboardType, const String& pasteboardName) OVERRIDE;
+ virtual void setPathnamesForType(const Vector<String>&, const String& pasteboardType, const String& pasteboardName) OVERRIDE;
+ virtual void setStringForType(const String&, const String& pasteboardType, const String& pasteboardName) OVERRIDE;
+#endif
+
bool m_pluginCacheIsPopulated;
bool m_shouldRefreshPlugins;
Vector<WebCore::PluginInfo> m_cachedPlugins;
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp
index f59e69700..9f3453067 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp
@@ -21,6 +21,7 @@
#include "WebEditorClient.h"
#include "Frame.h"
+#include "FrameDestructionObserver.h"
#include "PlatformKeyboardEvent.h"
#include "WebPage.h"
#include "WebPageProxyMessages.h"
@@ -130,7 +131,34 @@ void WebEditorClient::handleInputMethodKeydown(KeyboardEvent*)
}
#if PLATFORM(X11)
+class EditorClientFrameDestructionObserver : FrameDestructionObserver {
+public:
+ EditorClientFrameDestructionObserver(Frame* frame, GClosure* closure)
+ : FrameDestructionObserver(frame)
+ , m_closure(closure)
+ {
+ g_closure_add_finalize_notifier(m_closure, this, destroyOnClosureFinalization);
+ }
+
+ void frameDestroyed()
+ {
+ g_closure_invalidate(m_closure);
+ FrameDestructionObserver::frameDestroyed();
+ }
+private:
+ GClosure* m_closure;
+
+ static void destroyOnClosureFinalization(gpointer data, GClosure* closure)
+ {
+ // Calling delete void* will free the memory but won't invoke
+ // the destructor, something that is a must for us.
+ EditorClientFrameDestructionObserver* observer = static_cast<EditorClientFrameDestructionObserver*>(data);
+ delete observer;
+ }
+};
+
static Frame* frameSettingClipboard;
+
static void collapseSelection(GtkClipboard* clipboard, Frame* frame)
{
if (frameSettingClipboard && frameSettingClipboard == frame)
@@ -156,6 +184,10 @@ void WebEditorClient::setSelectionPrimaryClipboardIfNeeded(Frame* frame)
frameSettingClipboard = frame;
GClosure* callback = g_cclosure_new(G_CALLBACK(collapseSelection), frame, 0);
+ // This observer will be self-destroyed on closure finalization,
+ // that will happen either after closure execution or after
+ // closure invalidation.
+ new EditorClientFrameDestructionObserver(frame, callback);
g_closure_set_marshal(callback, g_cclosure_marshal_VOID__VOID);
PasteboardHelper::defaultPasteboardHelper()->writeClipboardContents(clipboard, PasteboardHelper::DoNotIncludeSmartPaste, callback);
frameSettingClipboard = 0;
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm b/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm
index 1cfa3c000..da608ddfb 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm
@@ -39,6 +39,7 @@
#import <WebCore/FrameView.h>
#import <WebCore/GraphicsContext.h>
#import <WebCore/LegacyWebArchive.h>
+#import <WebCore/Page.h>
#import <WebCore/RenderImage.h>
#import <WebCore/ResourceHandle.h>
#import <WebCore/StringTruncator.h>
@@ -77,9 +78,9 @@ using namespace WebKit;
namespace WebKit {
-static PassRefPtr<ShareableBitmap> convertImageToBitmap(NSImage *image)
+static PassRefPtr<ShareableBitmap> convertImageToBitmap(NSImage *image, const IntSize& size)
{
- RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(IntSize([image size]), ShareableBitmap::SupportsAlpha);
+ RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(size, ShareableBitmap::SupportsAlpha);
OwnPtr<GraphicsContext> graphicsContext = bitmap->createGraphicsContext();
RetainPtr<NSGraphicsContext> savedContext = [NSGraphicsContext currentContext];
@@ -94,7 +95,9 @@ static PassRefPtr<ShareableBitmap> convertImageToBitmap(NSImage *image)
void WebDragClient::startDrag(RetainPtr<NSImage> image, const IntPoint& point, const IntPoint&, Clipboard*, Frame* frame, bool linkDrag)
{
- RefPtr<ShareableBitmap> bitmap = convertImageToBitmap(image.get());
+ IntSize bitmapSize([image.get() size]);
+ bitmapSize.scale(frame->page()->deviceScaleFactor());
+ RefPtr<ShareableBitmap> bitmap = convertImageToBitmap(image.get(), bitmapSize);
ShareableBitmap::Handle handle;
if (!bitmap->createHandle(handle))
return;
@@ -122,10 +125,10 @@ static NSArray *arrayForURLsWithTitles(NSURL *URL, NSString *title)
[NSArray arrayWithObject:[title _webkit_stringByTrimmingWhitespace]], nil];
}
-void WebDragClient::declareAndWriteDragImage(NSPasteboard *pasteboard, DOMElement *element, NSURL *URL, NSString *title, WebCore::Frame*)
+void WebDragClient::declareAndWriteDragImage(const String& pasteboardName, DOMElement *element, NSURL *URL, NSString *title, WebCore::Frame*)
{
ASSERT(element);
- ASSERT(pasteboard && pasteboard == [NSPasteboard pasteboardWithName:NSDragPboard]);
+ ASSERT(pasteboardName == String(NSDragPboard));
Element* coreElement = core(element);
@@ -152,6 +155,7 @@ void WebDragClient::declareAndWriteDragImage(NSPasteboard *pasteboard, DOMElemen
m_pasteboardOwner.adoptNS([[WKPasteboardOwner alloc] initWithImage:image]);
m_filePromiseOwner.adoptNS([(WKPasteboardFilePromiseOwner *)[WKPasteboardFilePromiseOwner alloc] initWithSource:m_pasteboardOwner.get()]);
+ NSPasteboard* pasteboard = [NSPasteboard pasteboardWithName:pasteboardName];
[pasteboard declareTypes:types.get() owner:m_pasteboardOwner.leakRef()];
[pasteboard setPropertyList:[NSArray arrayWithObject:extension] forType:NSFilesPromisePboardType];
diff --git a/Source/WebKit2/WebProcess/WebPage/DecoderAdapter.cpp b/Source/WebKit2/WebProcess/WebPage/DecoderAdapter.cpp
index 19083d6ad..763305cbe 100644
--- a/Source/WebKit2/WebProcess/WebPage/DecoderAdapter.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/DecoderAdapter.cpp
@@ -52,6 +52,11 @@ bool DecoderAdapter::decodeBool(bool& value)
return m_decoder.decodeBool(value);
}
+bool DecoderAdapter::decodeUInt16(uint16_t& value)
+{
+ return m_decoder.decodeUInt16(value);
+}
+
bool DecoderAdapter::decodeUInt32(uint32_t& value)
{
return m_decoder.decodeUInt32(value);
diff --git a/Source/WebKit2/WebProcess/WebPage/DecoderAdapter.h b/Source/WebKit2/WebProcess/WebPage/DecoderAdapter.h
index bd34ea8d3..d6b4eb766 100644
--- a/Source/WebKit2/WebProcess/WebPage/DecoderAdapter.h
+++ b/Source/WebKit2/WebProcess/WebPage/DecoderAdapter.h
@@ -39,6 +39,7 @@ public:
private:
virtual bool decodeBytes(Vector<uint8_t>&);
virtual bool decodeBool(bool&);
+ virtual bool decodeUInt16(uint16_t&);
virtual bool decodeUInt32(uint32_t&);
virtual bool decodeUInt64(uint64_t&);
virtual bool decodeInt32(int32_t&);
diff --git a/Source/WebKit2/WebProcess/WebPage/DrawingArea.h b/Source/WebKit2/WebProcess/WebPage/DrawingArea.h
index 377c9001a..e9fa49c5d 100644
--- a/Source/WebKit2/WebProcess/WebPage/DrawingArea.h
+++ b/Source/WebKit2/WebProcess/WebPage/DrawingArea.h
@@ -105,6 +105,7 @@ private:
#if PLATFORM(MAC)
// Used by TiledCoreAnimationDrawingArea.
virtual void updateGeometry(const WebCore::IntSize& viewSize) { }
+ virtual void setDeviceScaleFactor(float deviceScaleFactor) { }
#endif
};
diff --git a/Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in b/Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in
index 41a1aa362..857f87293 100644
--- a/Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in
+++ b/Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in
@@ -30,5 +30,6 @@ messages -> DrawingArea {
#if PLATFORM(MAC)
// Used by TiledCoreAnimationDrawingArea.
UpdateGeometry(WebCore::IntSize viewSize)
+ SetDeviceScaleFactor(float deviceScaleFactor)
#endif
}
diff --git a/Source/WebKit2/WebProcess/WebPage/EncoderAdapter.cpp b/Source/WebKit2/WebProcess/WebPage/EncoderAdapter.cpp
index 1f0e13c71..bda7d9b72 100644
--- a/Source/WebKit2/WebProcess/WebPage/EncoderAdapter.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/EncoderAdapter.cpp
@@ -52,6 +52,11 @@ void EncoderAdapter::encodeBool(bool value)
m_encoder->encodeBool(value);
}
+void EncoderAdapter::encodeUInt16(uint16_t value)
+{
+ m_encoder->encodeUInt16(value);
+}
+
void EncoderAdapter::encodeUInt32(uint32_t value)
{
m_encoder->encodeUInt32(value);
diff --git a/Source/WebKit2/WebProcess/WebPage/EncoderAdapter.h b/Source/WebKit2/WebProcess/WebPage/EncoderAdapter.h
index 47de7afd5..6321cf513 100644
--- a/Source/WebKit2/WebProcess/WebPage/EncoderAdapter.h
+++ b/Source/WebKit2/WebProcess/WebPage/EncoderAdapter.h
@@ -46,6 +46,7 @@ public:
private:
virtual void encodeBytes(const uint8_t*, size_t);
virtual void encodeBool(bool);
+ virtual void encodeUInt16(uint16_t value);
virtual void encodeUInt32(uint32_t);
virtual void encodeUInt64(uint64_t);
virtual void encodeInt32(int32_t);
diff --git a/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp b/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp
index 7f3c08198..a53220610 100644
--- a/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp
@@ -37,6 +37,7 @@
#if ENABLE(THREADED_SCROLLING)
#include <WebCore/ScrollingCoordinator.h>
+#include <WebCore/ScrollingThread.h>
#include <WebCore/ScrollingTree.h>
#endif
@@ -79,18 +80,29 @@ void EventDispatcher::didReceiveMessageOnConnectionWorkQueue(CoreIPC::Connection
}
}
-void EventDispatcher::wheelEvent(CoreIPC::Connection*, uint64_t pageID, const WebWheelEvent& wheelEvent)
+void EventDispatcher::wheelEvent(CoreIPC::Connection*, uint64_t pageID, const WebWheelEvent& wheelEvent, bool canGoBack, bool canGoForward)
{
#if ENABLE(THREADED_SCROLLING)
MutexLocker locker(m_scrollingTreesMutex);
if (ScrollingTree* scrollingTree = m_scrollingTrees.get(pageID).get()) {
PlatformWheelEvent platformWheelEvent = platform(wheelEvent);
- if (scrollingTree->tryToHandleWheelEvent(platformWheelEvent)) {
- sendDidHandleEvent(pageID, wheelEvent);
+ // FIXME: It's pretty horrible that we're updating the back/forward state here.
+ // WebCore should always know the current state and know when it changes so the
+ // scrolling tree can be notified.
+ // We only need to do this at the beginning of the gesture.
+ if (platformWheelEvent.phase() == PlatformWheelEventPhaseBegan)
+ ScrollingThread::dispatch(bind(&ScrollingTree::updateBackForwardState, scrollingTree, canGoBack, canGoForward));
+
+ ScrollingTree::EventResult result = scrollingTree->tryToHandleWheelEvent(platformWheelEvent);
+ if (result == ScrollingTree::DidHandleEvent || result == ScrollingTree::DidNotHandleEvent) {
+ sendDidReceiveEvent(pageID, wheelEvent, result == ScrollingTree::DidHandleEvent);
return;
}
}
+#else
+ UNUSED_PARAM(canGoBack);
+ UNUSED_PARAM(canGoForward);
#endif
RunLoop::main()->dispatch(bind(&EventDispatcher::dispatchWheelEvent, this, pageID, wheelEvent));
@@ -128,9 +140,9 @@ void EventDispatcher::dispatchGestureEvent(uint64_t pageID, const WebGestureEven
#endif
#if ENABLE(THREADED_SCROLLING)
-void EventDispatcher::sendDidHandleEvent(uint64_t pageID, const WebEvent& event)
+void EventDispatcher::sendDidReceiveEvent(uint64_t pageID, const WebEvent& event, bool didHandleEvent)
{
- WebProcess::shared().connection()->send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(event.type()), true), pageID);
+ WebProcess::shared().connection()->send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(event.type()), didHandleEvent), pageID);
}
#endif
diff --git a/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h b/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h
index 15b25380d..aa70a93e5 100644
--- a/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h
+++ b/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h
@@ -66,7 +66,7 @@ private:
void didReceiveEventDispatcherMessageOnConnectionWorkQueue(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder* arguments, bool& didHandleMessage);
// Message handlers
- void wheelEvent(CoreIPC::Connection*, uint64_t pageID, const WebWheelEvent&);
+ void wheelEvent(CoreIPC::Connection*, uint64_t pageID, const WebWheelEvent&, bool canGoBack, bool canGoForward);
#if ENABLE(GESTURE_EVENTS)
void gestureEvent(CoreIPC::Connection*, uint64_t pageID, const WebGestureEvent&);
#endif
@@ -78,7 +78,7 @@ private:
#endif
#if ENABLE(THREADED_SCROLLING)
- void sendDidHandleEvent(uint64_t pageID, const WebEvent&);
+ void sendDidReceiveEvent(uint64_t pageID, const WebEvent&, bool didHandleEvent);
Mutex m_scrollingTreesMutex;
HashMap<uint64_t, RefPtr<WebCore::ScrollingTree> > m_scrollingTrees;
diff --git a/Source/WebKit2/WebProcess/WebPage/EventDispatcher.messages.in b/Source/WebKit2/WebProcess/WebPage/EventDispatcher.messages.in
index a15571be5..94cd5e501 100644
--- a/Source/WebKit2/WebProcess/WebPage/EventDispatcher.messages.in
+++ b/Source/WebKit2/WebProcess/WebPage/EventDispatcher.messages.in
@@ -21,7 +21,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
messages -> EventDispatcher {
- WheelEvent(uint64_t pageID, WebKit::WebWheelEvent event) DispatchOnConnectionQueue
+ WheelEvent(uint64_t pageID, WebKit::WebWheelEvent event, bool canGoBack, bool canGoForward) DispatchOnConnectionQueue
#if ENABLE(GESTURE_EVENTS)
GestureEvent(uint64_t pageID, WebKit::WebGestureEvent event) DispatchOnConnectionQueue
diff --git a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h b/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h
index 61fbe2fc3..6f336a5cd 100644
--- a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h
+++ b/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h
@@ -80,9 +80,9 @@ public:
virtual void resumeRendering() { }
#if USE(TILED_BACKING_STORE)
- virtual void setVisibleContentRectAndScale(const WebCore::IntRect&, float scale) { }
- virtual void setVisibleContentRectTrajectoryVector(const WebCore::FloatPoint&) { }
- virtual void setVisibleContentRectForLayer(int layerID, const WebCore::IntRect&) { }
+ virtual void setVisibleContentsRectForScaling(const WebCore::IntRect&, float scale) { }
+ virtual void setVisibleContentsRectForPanning(const WebCore::IntRect&, const WebCore::FloatPoint&) { }
+ virtual void setVisibleContentsRectForLayer(int layerID, const WebCore::IntRect&) { }
virtual void renderNextFrame() { }
virtual void purgeBackingStores() { }
virtual void didReceiveLayerTreeHostMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
diff --git a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.messages.in b/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.messages.in
index 4ee1cc3b4..70fa85841 100644
--- a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.messages.in
+++ b/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.messages.in
@@ -20,8 +20,8 @@
#if USE(TILED_BACKING_STORE)
messages -> LayerTreeHost {
- SetVisibleContentRectTrajectoryVector(WebCore::FloatPoint trajectoryVectory)
- SetVisibleContentRectAndScale(WebCore::IntRect contentRect, float scale)
+ SetVisibleContentsRectForPanning(WebCore::IntRect visibleContentsRect, WebCore::FloatPoint trajectoryVectory)
+ SetVisibleContentsRectForScaling(WebCore::IntRect visibleContentsRect, float scale)
RenderNextFrame()
PurgeBackingStores()
}
diff --git a/Source/WebKit2/WebProcess/WebPage/TiledBackingStoreRemoteTile.cpp b/Source/WebKit2/WebProcess/WebPage/TiledBackingStoreRemoteTile.cpp
index 7cea0b426..ee116c2e9 100644
--- a/Source/WebKit2/WebProcess/WebPage/TiledBackingStoreRemoteTile.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/TiledBackingStoreRemoteTile.cpp
@@ -72,29 +72,17 @@ Vector<IntRect> TiledBackingStoreRemoteTile::updateBackBuffer()
if (!isDirty())
return Vector<IntRect>();
- // FIXME: Only use a local buffer when we know the tile is animated (after the first invalidate)
- // and destroy it after a few seconds of inactivity. We can render directly to shared
- // memory in other cases.
- if (!m_localBuffer || m_localBuffer->size() != m_rect.size()) {
- m_localBuffer = ImageBuffer::create(m_rect.size());
- m_localBuffer->context()->translate(-m_rect.x(), -m_rect.y());
- m_localBuffer->context()->scale(FloatSize(m_tiledBackingStore->contentsScale(), m_tiledBackingStore->contentsScale()));
- }
- // This assumes that the GraphicsContext on the ImageBuffer acts synchronously
- // for us to be able to draw this buffer on the ShareableBitmap right after.
- m_tiledBackingStore->client()->tiledBackingStorePaint(m_localBuffer->context(), m_tiledBackingStore->mapToContents(m_dirtyRect));
-
- RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(m_rect.size(), ShareableBitmap::SupportsAlpha);
+ RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(m_dirtyRect.size(), m_tiledBackingStore->supportsAlpha() ? ShareableBitmap::SupportsAlpha : 0);
OwnPtr<GraphicsContext> graphicsContext(bitmap->createGraphicsContext());
- graphicsContext->drawImageBuffer(m_localBuffer.get(), ColorSpaceDeviceRGB, IntPoint(0, 0));
-
-#if PLATFORM(QT)
- // Qt uses BGRA interally, we swizzle to RGBA for OpenGL.
- bitmap->swizzleRGB();
-#endif
+ graphicsContext->translate(-m_dirtyRect.x(), -m_dirtyRect.y());
+ graphicsContext->scale(FloatSize(m_tiledBackingStore->contentsScale(), m_tiledBackingStore->contentsScale()));
+ m_tiledBackingStore->client()->tiledBackingStorePaint(graphicsContext.get(), m_tiledBackingStore->mapToContents(m_dirtyRect));
UpdateInfo updateInfo;
updateInfo.updateRectBounds = m_rect;
+ IntRect updateRect = m_dirtyRect;
+ updateRect.move(-m_rect.x(), -m_rect.y());
+ updateInfo.updateRects.append(updateRect);
updateInfo.updateScaleFactor = m_tiledBackingStore->contentsScale();
bitmap->createHandle(updateInfo.bitmapHandle);
diff --git a/Source/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.cpp b/Source/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.cpp
index 7a6045eb6..cbdc066da 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.cpp
@@ -163,7 +163,9 @@ void WebBackForwardListProxy::goToItem(HistoryItem* item)
if (!m_page)
return;
- m_page->send(Messages::WebPageProxy::BackForwardGoToItem(historyItemToIDMap().get(item)));
+ SandboxExtension::Handle sandboxExtensionHandle;
+ m_page->sendSync(Messages::WebPageProxy::BackForwardGoToItem(historyItemToIDMap().get(item)), Messages::WebPageProxy::BackForwardGoToItem::Reply(sandboxExtensionHandle));
+ m_page->sandboxExtensionTracker().beginLoad(m_page->mainWebFrame(), sandboxExtensionHandle);
}
HistoryItem* WebBackForwardListProxy::itemAtIndex(int itemIndex)
diff --git a/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp b/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
index a829fe45b..ac869fbea 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
@@ -650,7 +650,7 @@ JSValueRef WebFrame::computedStyleIncludingVisitedInfo(JSObjectRef element)
if (!toJS(element)->inherits(&JSElement::s_info))
return JSValueMakeUndefined(toRef(exec));
- RefPtr<CSSComputedStyleDeclaration> style = computedStyle(static_cast<JSElement*>(toJS(element))->impl(), true);
+ RefPtr<CSSComputedStyleDeclaration> style = CSSComputedStyleDeclaration::create(static_cast<JSElement*>(toJS(element))->impl(), true);
JSLock lock(SilenceAssertionsOnly);
return toRef(exec, toJS(exec, globalObject, style.get()));
diff --git a/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp b/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp
index e1383c832..5a42d116e 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp
@@ -28,6 +28,7 @@
#if ENABLE(INSPECTOR)
+#include "WebFrame.h"
#include "WebInspectorFrontendClient.h"
#include "WebInspectorProxyMessages.h"
#include "WebPage.h"
@@ -139,6 +140,24 @@ void WebInspector::showConsole()
m_frontendClient->showConsole();
}
+void WebInspector::showResources()
+{
+ m_page->corePage()->inspectorController()->show();
+ if (m_frontendClient)
+ m_frontendClient->showResources();
+}
+
+void WebInspector::showMainResourceForFrame(uint64_t frameID)
+{
+ WebFrame* frame = WebProcess::shared().webFrame(frameID);
+ if (!frame)
+ return;
+
+ m_page->corePage()->inspectorController()->show();
+ if (m_frontendClient)
+ m_frontendClient->showMainResourceForFrame(frame->coreFrame());
+}
+
void WebInspector::startJavaScriptDebugging()
{
#if ENABLE(JAVASCRIPT_DEBUGGER)
diff --git a/Source/WebKit2/WebProcess/WebPage/WebInspector.h b/Source/WebKit2/WebProcess/WebPage/WebInspector.h
index 79ff8074a..221b97671 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebInspector.h
+++ b/Source/WebKit2/WebProcess/WebPage/WebInspector.h
@@ -92,6 +92,10 @@ private:
void showConsole();
+ void showResources();
+
+ void showMainResourceForFrame(uint64_t frameID);
+
void startJavaScriptDebugging();
void stopJavaScriptDebugging();
diff --git a/Source/WebKit2/WebProcess/WebPage/WebInspector.messages.in b/Source/WebKit2/WebProcess/WebPage/WebInspector.messages.in
index dc184b68a..a1a80f07f 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebInspector.messages.in
+++ b/Source/WebKit2/WebProcess/WebPage/WebInspector.messages.in
@@ -26,6 +26,8 @@ messages -> WebInspector {
Show()
Close()
ShowConsole()
+ ShowResources()
+ ShowMainResourceForFrame(uint64_t frameID)
StartJavaScriptDebugging()
StopJavaScriptDebugging()
StartJavaScriptProfiling()
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
index 4aa1e45e8..dad810491 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -210,6 +210,7 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters)
, m_numWheelEventHandlers(0)
, m_cachedPageCount(0)
, m_isShowingContextMenu(false)
+ , m_willGoToBackForwardItemCallbackEnabled(true)
#if PLATFORM(WIN)
, m_gestureReachedScrollingLimit(false)
#endif
@@ -231,12 +232,13 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters)
#if ENABLE(INSPECTOR)
pageClients.inspectorClient = new WebInspectorClient(this);
#endif
-#if ENABLE(NOTIFICATIONS)
- pageClients.notificationClient = new WebNotificationClient(this);
-#endif
m_page = adoptPtr(new Page(pageClients));
+#if ENABLE(NOTIFICATIONS)
+ WebCore::provideNotification(m_page.get(), new WebNotificationClient(this));
+#endif
+
// Qt does not yet call setIsInWindow. Until it does, just leave
// this line out so plug-ins and video will work. Eventually all platforms
// should call setIsInWindow and this comment and #if should be removed,
@@ -713,14 +715,15 @@ void WebPage::setDefersLoading(bool defersLoading)
m_page->setDefersLoading(defersLoading);
}
-void WebPage::reload(bool reloadFromOrigin)
+void WebPage::reload(bool reloadFromOrigin, const SandboxExtension::Handle& sandboxExtensionHandle)
{
SendStopResponsivenessTimer stopper(this);
+ m_sandboxExtensionTracker.beginLoad(m_mainFrame.get(), sandboxExtensionHandle);
m_mainFrame->coreFrame()->loader()->reload(reloadFromOrigin);
}
-void WebPage::goForward(uint64_t backForwardItemID, const SandboxExtension::Handle& sandboxExtensionHandle)
+void WebPage::goForward(uint64_t backForwardItemID)
{
SendStopResponsivenessTimer stopper(this);
@@ -729,11 +732,10 @@ void WebPage::goForward(uint64_t backForwardItemID, const SandboxExtension::Hand
if (!item)
return;
- m_sandboxExtensionTracker.beginLoad(m_mainFrame.get(), sandboxExtensionHandle);
m_page->goToItem(item, FrameLoadTypeForward);
}
-void WebPage::goBack(uint64_t backForwardItemID, const SandboxExtension::Handle& sandboxExtensionHandle)
+void WebPage::goBack(uint64_t backForwardItemID)
{
SendStopResponsivenessTimer stopper(this);
@@ -742,11 +744,10 @@ void WebPage::goBack(uint64_t backForwardItemID, const SandboxExtension::Handle&
if (!item)
return;
- m_sandboxExtensionTracker.beginLoad(m_mainFrame.get(), sandboxExtensionHandle);
m_page->goToItem(item, FrameLoadTypeBack);
}
-void WebPage::goToBackForwardItem(uint64_t backForwardItemID, const SandboxExtension::Handle& sandboxExtensionHandle)
+void WebPage::goToBackForwardItem(uint64_t backForwardItemID)
{
SendStopResponsivenessTimer stopper(this);
@@ -755,7 +756,6 @@ void WebPage::goToBackForwardItem(uint64_t backForwardItemID, const SandboxExten
if (!item)
return;
- m_sandboxExtensionTracker.beginLoad(m_mainFrame.get(), sandboxExtensionHandle);
m_page->goToItem(item, FrameLoadTypeIndexedBackForward);
}
@@ -1439,10 +1439,10 @@ uint64_t WebPage::restoreSession(const SessionState& sessionState)
return currentItemID;
}
-void WebPage::restoreSessionAndNavigateToCurrentItem(const SessionState& sessionState, const SandboxExtension::Handle& sandboxExtensionHandle)
+void WebPage::restoreSessionAndNavigateToCurrentItem(const SessionState& sessionState)
{
if (uint64_t currentItemID = restoreSession(sessionState))
- goToBackForwardItem(currentItemID, sandboxExtensionHandle);
+ goToBackForwardItem(currentItemID);
}
#if ENABLE(TOUCH_EVENTS)
@@ -1888,6 +1888,7 @@ void WebPage::updatePreferences(const WebPreferencesStore& store)
settings->setShowDebugBorders(store.getBoolValueForKey(WebPreferencesKey::compositingBordersVisibleKey()));
settings->setShowRepaintCounter(store.getBoolValueForKey(WebPreferencesKey::compositingRepaintCountersVisibleKey()));
settings->setCSSCustomFilterEnabled(store.getBoolValueForKey(WebPreferencesKey::cssCustomFilterEnabledKey()));
+ settings->setCSSRegionsEnabled(store.getBoolValueForKey(WebPreferencesKey::cssRegionsEnabledKey()));
settings->setWebGLEnabled(store.getBoolValueForKey(WebPreferencesKey::webGLEnabledKey()));
settings->setMediaPlaybackRequiresUserGesture(store.getBoolValueForKey(WebPreferencesKey::mediaPlaybackRequiresUserGestureKey()));
settings->setMediaPlaybackAllowsInline(store.getBoolValueForKey(WebPreferencesKey::mediaPlaybackAllowsInlineKey()));
@@ -1925,7 +1926,7 @@ void WebPage::updatePreferences(const WebPreferencesStore& store)
#endif
settings->setApplicationChromeMode(store.getBoolValueForKey(WebPreferencesKey::applicationChromeModeKey()));
- settings->setSuppressIncrementalRendering(store.getBoolValueForKey(WebPreferencesKey::suppressIncrementalRenderingKey()));
+ settings->setSuppressesIncrementalRendering(store.getBoolValueForKey(WebPreferencesKey::suppressesIncrementalRenderingKey()));
settings->setBackspaceKeyNavigationEnabled(store.getBoolValueForKey(WebPreferencesKey::backspaceKeyNavigationEnabledKey()));
settings->setCaretBrowsingEnabled(store.getBoolValueForKey(WebPreferencesKey::caretBrowsingEnabledKey()));
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.h b/Source/WebKit2/WebProcess/WebPage/WebPage.h
index aa1e57f08..745bf4d4a 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.h
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.h
@@ -503,6 +503,8 @@ public:
void numWheelEventHandlersChanged(unsigned);
void recomputeShortCircuitHorizontalWheelEventsState();
+ bool willGoToBackForwardItemCallbackEnabled() const { return m_willGoToBackForwardItemCallbackEnabled; }
+
private:
WebPage(uint64_t pageID, const WebPageCreationParameters&);
@@ -536,10 +538,10 @@ private:
void loadAlternateHTMLString(const String& htmlString, const String& baseURL, const String& unreachableURL);
void loadPlainTextString(const String&);
void linkClicked(const String& url, const WebMouseEvent&);
- void reload(bool reloadFromOrigin);
- void goForward(uint64_t, const SandboxExtension::Handle&);
- void goBack(uint64_t, const SandboxExtension::Handle&);
- void goToBackForwardItem(uint64_t, const SandboxExtension::Handle&);
+ void reload(bool reloadFromOrigin, const SandboxExtension::Handle&);
+ void goForward(uint64_t);
+ void goBack(uint64_t);
+ void goToBackForwardItem(uint64_t);
void tryRestoreScrollPosition();
void setActive(bool);
void setFocused(bool);
@@ -567,10 +569,12 @@ private:
static void logicalScroll(WebCore::Page*, WebCore::ScrollLogicalDirection, WebCore::ScrollGranularity);
uint64_t restoreSession(const SessionState&);
- void restoreSessionAndNavigateToCurrentItem(const SessionState&, const SandboxExtension::Handle&);
+ void restoreSessionAndNavigateToCurrentItem(const SessionState&);
void didRemoveBackForwardItem(uint64_t);
+ void setWillGoToBackForwardItemCallbackEnabled(bool enabled) { m_willGoToBackForwardItemCallbackEnabled = enabled; }
+
void setDrawsBackground(bool);
void setDrawsTransparentBackground(bool);
@@ -765,6 +769,8 @@ private:
unsigned m_cachedPageCount;
bool m_isShowingContextMenu;
+
+ bool m_willGoToBackForwardItemCallbackEnabled;
#if PLATFORM(WIN)
bool m_gestureReachedScrollingLimit;
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in b/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
index 415460137..7813adf3c 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
@@ -50,9 +50,9 @@ messages -> WebPage {
ScrollBy(uint32_t scrollDirection, uint32_t scrollGranularity)
CenterSelectionInVisibleArea()
- GoBack(uint64_t backForwardItemID, WebKit::SandboxExtension::Handle sandboxExtensionHandle)
- GoForward(uint64_t backForwardItemID, WebKit::SandboxExtension::Handle sandboxExtensionHandle)
- GoToBackForwardItem(uint64_t backForwardItemID, WebKit::SandboxExtension::Handle sandboxExtensionHandle)
+ GoBack(uint64_t backForwardItemID)
+ GoForward(uint64_t backForwardItemID)
+ GoToBackForwardItem(uint64_t backForwardItemID)
TryRestoreScrollPosition()
LoadHTMLString(WTF::String htmlString, WTF::String baseURL)
LoadAlternateHTMLString(WTF::String htmlString, WTF::String baseURL, WTF::String unreachableURL);
@@ -60,7 +60,7 @@ messages -> WebPage {
LoadURL(WTF::String url, WebKit::SandboxExtension::Handle sandboxExtensionHandle)
LoadURLRequest(WebCore::ResourceRequest request, WebKit::SandboxExtension::Handle sandboxExtensionHandle)
LinkClicked(WTF::String url, WebKit::WebMouseEvent event)
- Reload(bool reloadFromOrigin)
+ Reload(bool reloadFromOrigin, WebKit::SandboxExtension::Handle sandboxExtensionHandle)
StopLoading()
#if PLATFORM(QT)
@@ -71,9 +71,10 @@ messages -> WebPage {
StopLoadingFrame(uint64_t frameID)
RestoreSession(WebKit::SessionState state)
- RestoreSessionAndNavigateToCurrentItem(WebKit::SessionState state, WebKit::SandboxExtension::Handle sandboxExtensionHandle)
+ RestoreSessionAndNavigateToCurrentItem(WebKit::SessionState state)
DidRemoveBackForwardItem(uint64_t backForwardItemID)
+ SetWillGoToBackForwardItemCallbackEnabled(bool willGoToBackForwardItemEnabled)
DidReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction, uint64_t downloadID)
diff --git a/Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp b/Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp
index 704adf3ea..b0440cf33 100644
--- a/Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp
@@ -55,21 +55,15 @@ public:
static gboolean enumeratePrintersFunction(GtkPrinter* printer, WebPrintOperationGtkUnix* printOperation)
{
- GtkPrinter* selectedPrinter = 0;
const char* printerName = gtk_print_settings_get_printer(printOperation->printSettings());
- if (printerName) {
- if (!strcmp(printerName, gtk_printer_get_name(printer)))
- selectedPrinter = printer;
- } else if (gtk_printer_is_default(printer))
- selectedPrinter = printer;
-
- if (!selectedPrinter)
+ if ((printerName && strcmp(printerName, gtk_printer_get_name(printer)))
+ || (!printerName && !gtk_printer_is_default(printer)))
return FALSE;
static int jobNumber = 0;
const char* applicationName = g_get_application_name();
GOwnPtr<char>jobName(g_strdup_printf("%s job #%d", applicationName ? applicationName : "WebKit", ++jobNumber));
- printOperation->m_printJob = adoptGRef(gtk_print_job_new(jobName.get(), selectedPrinter,
+ printOperation->m_printJob = adoptGRef(gtk_print_job_new(jobName.get(), printer,
printOperation->printSettings(),
printOperation->pageSetup()));
return TRUE;
@@ -94,6 +88,15 @@ public:
printOperation->m_pagesToPrint = gtk_print_job_get_pages(printOperation->m_printJob.get());
printOperation->m_needsRotation = gtk_print_job_get_rotate(printOperation->m_printJob.get());
+ // Manual capabilities.
+ printOperation->m_numberUp = gtk_print_job_get_n_up(printOperation->m_printJob.get());
+ printOperation->m_numberUpLayout = gtk_print_job_get_n_up_layout(printOperation->m_printJob.get());
+ printOperation->m_pageSet = gtk_print_job_get_page_set(printOperation->m_printJob.get());
+ printOperation->m_reverse = gtk_print_job_get_reverse(printOperation->m_printJob.get());
+ printOperation->m_copies = gtk_print_job_get_num_copies(printOperation->m_printJob.get());
+ printOperation->m_collateCopies = gtk_print_job_get_collate(printOperation->m_printJob.get());
+ printOperation->m_scale = gtk_print_job_get_scale(printOperation->m_printJob.get());
+
printOperation->print(surface, 72, 72);
}
@@ -107,6 +110,9 @@ public:
void startPage(cairo_t* cr)
{
+ if (!currentPageIsFirstPageOfSheet())
+ return;
+
GtkPaperSize* paperSize = gtk_page_setup_get_paper_size(m_pageSetup.get());
double width = gtk_paper_size_get_width(paperSize, GTK_UNIT_POINTS);
double height = gtk_paper_size_get_height(paperSize, GTK_UNIT_POINTS);
@@ -133,7 +139,8 @@ public:
void endPage(cairo_t* cr)
{
- cairo_show_page(cr);
+ if (currentPageIsLastPageOfSheet())
+ cairo_show_page(cr);
}
static void printJobComplete(GtkPrintJob* printJob, WebPrintOperationGtkUnix* printOperation, const GError*)
@@ -196,9 +203,22 @@ struct PrintPagesData {
: printOperation(printOperation)
, totalPrinted(-1)
, pageNumber(0)
- , pagePosition(0)
+ , sheetNumber(0)
+ , firstSheetNumber(0)
+ , numberOfSheets(0)
+ , firstPagePosition(0)
+ , collated(0)
+ , uncollated(0)
, isDone(false)
{
+ if (printOperation->collateCopies()) {
+ collatedCopies = printOperation->copies();
+ uncollatedCopies = 1;
+ } else {
+ collatedCopies = 1;
+ uncollatedCopies = printOperation->copies();
+ }
+
if (printOperation->pagesToPrint() == GTK_PRINT_PAGES_RANGES) {
Vector<GtkPageRange> pageRanges;
GtkPageRange* ranges = printOperation->pageRanges();
@@ -227,8 +247,63 @@ struct PrintPagesData {
for (int i = 0; i < printOperation->pageCount(); ++i)
pages.append(i);
}
+ printOperation->setNumberOfPagesToPrint(pages.size());
+
+ size_t numberUp = printOperation->numberUp();
+ if (numberUp > 1)
+ numberOfSheets = (pages.size() % numberUp) ? pages.size() / numberUp + 1 : pages.size() / numberUp;
+ else
+ numberOfSheets = pages.size();
+
+ bool reverse = printOperation->reverse();
+ switch (printOperation->pageSet()) {
+ case GTK_PAGE_SET_ODD:
+ if (reverse) {
+ lastPagePosition = std::min(numberUp - 1, pages.size() - 1);
+ sheetNumber = (numberOfSheets - 1) - (numberOfSheets - 1) % 2;
+ } else
+ lastPagePosition = std::min(((numberOfSheets - 1) - ((numberOfSheets - 1) % 2)) * numberUp - 1, pages.size() - 1);
+ break;
+ case GTK_PAGE_SET_EVEN:
+ if (reverse) {
+ lastPagePosition = std::min(2 * numberUp - 1, pages.size() - 1);
+ sheetNumber = (numberOfSheets - 1) - (1 - (numberOfSheets - 1) % 2);
+ } else {
+ lastPagePosition = std::min(((numberOfSheets - 1) - (1 - (numberOfSheets - 1) % 2)) * numberUp - 1, pages.size() - 1);
+ sheetNumber = numberOfSheets > 1 ? 1 : -1;
+ }
+ break;
+ case GTK_PAGE_SET_ALL:
+ if (reverse) {
+ lastPagePosition = std::min(numberUp - 1, pages.size() - 1);
+ sheetNumber = pages.size() - 1;
+ } else
+ lastPagePosition = pages.size() - 1;
+ break;
+ }
- pageNumber = pages[pagePosition];
+ // FIXME: check pagePostion is between [0..pages.size() - 1]
+ // and cancel the operation otherwise when error reporting
+ // is implemented.
+ printOperation->setPagePosition(sheetNumber * numberUp);
+ pageNumber = pages[printOperation->pagePosition()];
+ firstPagePosition = printOperation->pagePosition();
+ firstSheetNumber = sheetNumber;
+ }
+
+ size_t collatedCopiesLeft()
+ {
+ return collatedCopies > 1 ? collatedCopies - collated - 1 : 0;
+ }
+
+ size_t uncollatedCopiesLeft()
+ {
+ return uncollatedCopies > 1 ? uncollatedCopies - uncollated - 1 : 0;
+ }
+
+ size_t copiesLeft()
+ {
+ return collatedCopiesLeft() + uncollatedCopiesLeft();
}
void incrementPageSequence()
@@ -238,8 +313,30 @@ struct PrintPagesData {
return;
}
- pagePosition++;
- if (pagePosition >= pages.size()) {
+ size_t pagePosition = printOperation->pagePosition();
+ if (pagePosition == lastPagePosition && !copiesLeft()) {
+ isDone = true;
+ return;
+ }
+
+ if (pagePosition == lastPagePosition && uncollatedCopiesLeft()) {
+ pagePosition = firstPagePosition;
+ sheetNumber = firstSheetNumber;
+ uncollated++;
+ } else if (printOperation->currentPageIsLastPageOfSheet()) {
+ if (!collatedCopiesLeft()) {
+ int step = printOperation->pageSet() == GTK_PAGE_SET_ALL ? 1 : 2;
+ step *= printOperation->reverse() ? -1 : 1;
+ sheetNumber += step;
+ collated = 0;
+ } else
+ collated++;
+ pagePosition = sheetNumber * printOperation->numberUp();
+ } else
+ pagePosition++;
+ printOperation->setPagePosition(pagePosition);
+
+ if (pagePosition >= pages.size() || sheetNumber >= numberOfSheets) {
isDone = true;
return;
}
@@ -252,8 +349,16 @@ struct PrintPagesData {
int totalPrinted;
size_t totalToPrint;
int pageNumber;
- size_t pagePosition;
Vector<size_t> pages;
+ size_t sheetNumber;
+ size_t firstSheetNumber;
+ size_t numberOfSheets;
+ size_t firstPagePosition;
+ size_t lastPagePosition;
+ size_t collated;
+ size_t uncollated;
+ size_t collatedCopies;
+ size_t uncollatedCopies;
bool isDone : 1;
};
@@ -262,9 +367,10 @@ PassRefPtr<WebPrintOperationGtk> WebPrintOperationGtk::create(WebPage* page, con
{
#ifdef HAVE_GTK_UNIX_PRINTING
return adoptRef(new WebPrintOperationGtkUnix(page, printInfo));
-#endif
-#ifdef G_OS_WIN32
+#elif defined(G_OS_WIN32)
return adoptRef(new WebPrintOperationGtkWin32(page, printInfo));
+#else
+ return 0;
#endif
}
@@ -277,10 +383,19 @@ WebPrintOperationGtk::WebPrintOperationGtk(WebPage* page, const PrintInfo& print
, m_xDPI(1)
, m_yDPI(1)
, m_printPagesIdleId(0)
+ , m_numberOfPagesToPrint(0)
, m_pagesToPrint(GTK_PRINT_PAGES_ALL)
+ , m_pagePosition(0)
, m_pageRanges(0)
, m_pageRangesCount(0)
, m_needsRotation(false)
+ , m_numberUp(1)
+ , m_numberUpLayout(0)
+ , m_pageSet(GTK_PAGE_SET_ALL)
+ , m_reverse(false)
+ , m_copies(1)
+ , m_collateCopies(false)
+ , m_scale(1)
{
}
@@ -295,8 +410,21 @@ int WebPrintOperationGtk::pageCount() const
return m_printContext ? m_printContext->pageCount() : 0;
}
-void WebPrintOperationGtk::rotatePage()
+bool WebPrintOperationGtk::currentPageIsFirstPageOfSheet() const
+{
+ return (m_numberUp < 2 || !((m_pagePosition) % m_numberUp));
+}
+
+bool WebPrintOperationGtk::currentPageIsLastPageOfSheet() const
{
+ return (m_numberUp < 2 || !((m_pagePosition + 1) % m_numberUp) || m_pagePosition == m_numberOfPagesToPrint - 1);
+}
+
+void WebPrintOperationGtk::rotatePageIfNeeded()
+{
+ if (!m_needsRotation)
+ return;
+
GtkPaperSize* paperSize = gtk_page_setup_get_paper_size(m_pageSetup.get());
double width = gtk_paper_size_get_width(paperSize, GTK_UNIT_INCH) * m_xDPI;
double height = gtk_paper_size_get_height(paperSize, GTK_UNIT_INCH) * m_yDPI;
@@ -324,22 +452,191 @@ void WebPrintOperationGtk::rotatePage()
}
}
+void WebPrintOperationGtk::getRowsAndColumnsOfPagesPerSheet(size_t& rows, size_t& columns)
+{
+ switch (m_numberUp) {
+ default:
+ columns = 1;
+ rows = 1;
+ break;
+ case 2:
+ columns = 2;
+ rows = 1;
+ break;
+ case 4:
+ columns = 2;
+ rows = 2;
+ break;
+ case 6:
+ columns = 3;
+ rows = 2;
+ break;
+ case 9:
+ columns = 3;
+ rows = 3;
+ break;
+ case 16:
+ columns = 4;
+ rows = 4;
+ break;
+ }
+}
+
+void WebPrintOperationGtk::getPositionOfPageInSheet(size_t rows, size_t columns, int& x, int&y)
+{
+ switch (m_numberUpLayout) {
+ case GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM:
+ x = m_pagePosition % columns;
+ y = (m_pagePosition / columns) % rows;
+ break;
+ case GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP:
+ x = m_pagePosition % columns;
+ y = rows - 1 - (m_pagePosition / columns) % rows;
+ break;
+ case GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM:
+ x = columns - 1 - m_pagePosition % columns;
+ y = (m_pagePosition / columns) % rows;
+ break;
+ case GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP:
+ x = columns - 1 - m_pagePosition % columns;
+ y = rows - 1 - (m_pagePosition / columns) % rows;
+ break;
+ case GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT:
+ x = (m_pagePosition / rows) % columns;
+ y = m_pagePosition % rows;
+ break;
+ case GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT:
+ x = columns - 1 - (m_pagePosition / rows) % columns;
+ y = m_pagePosition % rows;
+ break;
+ case GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT:
+ x = (m_pagePosition / rows) % columns;
+ y = rows - 1 - m_pagePosition % rows;
+ break;
+ case GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT:
+ x = columns - 1 - (m_pagePosition / rows) % columns;
+ y = rows - 1 - m_pagePosition % rows;
+ break;
+ }
+}
+
+void WebPrintOperationGtk::prepareContextToDraw()
+{
+ if (m_numberUp < 2) {
+ double left = gtk_page_setup_get_left_margin(m_pageSetup.get(), GTK_UNIT_INCH);
+ double top = gtk_page_setup_get_top_margin(m_pageSetup.get(), GTK_UNIT_INCH);
+ if (m_scale != 1.0)
+ cairo_scale(m_cairoContext.get(), m_scale, m_scale);
+ rotatePageIfNeeded();
+ cairo_translate(m_cairoContext.get(), left * m_xDPI, top * m_yDPI);
+
+ return;
+ }
+
+ rotatePageIfNeeded();
+
+ // Multiple pages per sheet.
+ double marginLeft = gtk_page_setup_get_left_margin(m_pageSetup.get(), GTK_UNIT_POINTS);
+ double marginRight = gtk_page_setup_get_right_margin(m_pageSetup.get(), GTK_UNIT_POINTS);
+ double marginTop = gtk_page_setup_get_top_margin(m_pageSetup.get(), GTK_UNIT_POINTS);
+ double marginBottom = gtk_page_setup_get_bottom_margin(m_pageSetup.get(), GTK_UNIT_POINTS);
+
+ double paperWidth = gtk_page_setup_get_paper_width(m_pageSetup.get(), GTK_UNIT_POINTS);
+ double paperHeight = gtk_page_setup_get_paper_height(m_pageSetup.get(), GTK_UNIT_POINTS);
+
+ size_t rows, columns;
+ getRowsAndColumnsOfPagesPerSheet(rows, columns);
+
+ GtkPageOrientation orientation = gtk_page_setup_get_orientation(m_pageSetup.get());
+ double pageWidth = 0, pageHeight = 0;
+ switch (orientation) {
+ case GTK_PAGE_ORIENTATION_PORTRAIT:
+ case GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT:
+ pageWidth = paperWidth - (marginLeft + marginRight);
+ pageHeight = paperHeight - (marginTop + marginBottom);
+ cairo_translate(m_cairoContext.get(), marginLeft, marginTop);
+ break;
+ case GTK_PAGE_ORIENTATION_LANDSCAPE:
+ case GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE:
+ pageWidth = paperWidth - (marginTop + marginBottom);
+ pageHeight = paperHeight - (marginLeft + marginRight);
+ cairo_translate(m_cairoContext.get(), marginTop, marginLeft);
+
+ size_t tmp = columns;
+ columns = rows;
+ rows = tmp;
+ break;
+ }
+
+ int x, y;
+ getPositionOfPageInSheet(rows, columns, x, y);
+
+ switch (m_numberUp) {
+ case 4:
+ case 9:
+ case 16: {
+ double scaleX = pageWidth / (columns * paperWidth);
+ double scaleY = pageHeight / (rows * paperHeight);
+ double scale = std::min(scaleX, scaleY);
+
+ double stepX = paperWidth * (scaleX / scale);
+ double stepY = paperHeight * (scaleY / scale);
+
+ double width = gtk_page_setup_get_page_width(m_pageSetup.get(), GTK_UNIT_INCH) * m_xDPI;
+ double height = gtk_page_setup_get_page_height(m_pageSetup.get(), GTK_UNIT_INCH) * m_yDPI;
+
+ double offsetX, offsetY;
+ if (marginLeft + marginRight > 0) {
+ offsetX = marginLeft * (stepX - width) / (marginLeft + marginRight);
+ offsetY = marginTop * (stepY - height) / (marginTop + marginBottom);
+ } else {
+ offsetX = (stepX - width) / 2.0;
+ offsetY = (stepY - height) / 2.0;
+ }
+
+ cairo_scale(m_cairoContext.get(), scale, scale);
+ cairo_translate(m_cairoContext.get(), x * stepX + offsetX, y * stepY + offsetY);
+ if (m_scale != 1.0)
+ cairo_scale(m_cairoContext.get(), m_scale, m_scale);
+ break;
+ }
+ case 2:
+ case 6: {
+ double scaleX = pageHeight / (columns * paperWidth);
+ double scaleY = pageWidth / (rows * paperHeight);
+ double scale = std::min(scaleX, scaleY);
+
+ double stepX = paperWidth * (scaleX / scale);
+ double stepY = paperHeight * (scaleY / scale);
+
+ double offsetX = ((stepX - paperWidth) / 2.0 * columns) - marginRight;
+ double offsetY = ((stepY - paperHeight) / 2.0 * rows) + marginTop;
+
+ cairo_scale(m_cairoContext.get(), scale, scale);
+ cairo_translate(m_cairoContext.get(), y * paperHeight + offsetY, (columns - x) * paperWidth + offsetX);
+ if (m_scale != 1.0)
+ cairo_scale(m_cairoContext.get(), m_scale, m_scale);
+ cairo_rotate(m_cairoContext.get(), -G_PI / 2);
+ break;
+ }
+ default:
+ break;
+ }
+}
+
void WebPrintOperationGtk::renderPage(int pageNumber)
{
startPage(m_cairoContext.get());
+ cairo_save(m_cairoContext.get());
- if (m_needsRotation)
- rotatePage();
-
- double left = gtk_page_setup_get_left_margin(m_pageSetup.get(), GTK_UNIT_INCH);
- double top = gtk_page_setup_get_top_margin(m_pageSetup.get(), GTK_UNIT_INCH);
- cairo_translate(m_cairoContext.get(), left * m_xDPI, top * m_yDPI);
+ prepareContextToDraw();
double pageWidth = gtk_page_setup_get_page_width(m_pageSetup.get(), GTK_UNIT_INCH) * m_xDPI;
WebCore::PlatformContextCairo platformContext(m_cairoContext.get());
WebCore::GraphicsContext graphicsContext(&platformContext);
- m_printContext->spoolPage(graphicsContext, pageNumber, pageWidth);
+ m_printContext->spoolPage(graphicsContext, pageNumber, pageWidth / m_scale);
+ cairo_restore(m_cairoContext.get());
endPage(m_cairoContext.get());
}
diff --git a/Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.h b/Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.h
index b142c4f63..5821a2ed3 100644
--- a/Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.h
+++ b/Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.h
@@ -51,11 +51,24 @@ public:
GtkPrintSettings* printSettings() const { return m_printSettings.get(); }
GtkPageSetup* pageSetup() const { return m_pageSetup.get(); }
+ void setNumberOfPagesToPrint(size_t numberOfPages) { m_numberOfPagesToPrint = numberOfPages; }
unsigned int pagesToPrint() const { return m_pagesToPrint; }
int pageCount() const;
+ bool currentPageIsFirstPageOfSheet() const;
+ bool currentPageIsLastPageOfSheet() const;
+ size_t pagePosition() const { return m_pagePosition; }
+ void setPagePosition(size_t position) { m_pagePosition = position; }
GtkPageRange* pageRanges() const { return m_pageRanges; }
size_t pageRangesCount() const { return m_pageRangesCount; }
+ unsigned int numberUp() const { return m_numberUp; }
+ unsigned int numberUpLayout() const { return m_numberUpLayout; }
+ unsigned int pageSet() const { return m_pageSet; }
+ bool reverse() const { return m_reverse; }
+ unsigned int copies() const { return m_copies; }
+ bool collateCopies() const { return m_collateCopies; }
+ double scale() const { return m_scale; }
+
virtual void startPrint(WebCore::PrintContext*, uint64_t callbackID) = 0;
protected:
@@ -70,7 +83,10 @@ protected:
void print(cairo_surface_t*, double xDPI, double yDPI);
void renderPage(int pageNumber);
- void rotatePage();
+ void rotatePageIfNeeded();
+ void getRowsAndColumnsOfPagesPerSheet(size_t& rows, size_t& columns);
+ void getPositionOfPageInSheet(size_t rows, size_t columns, int& x, int&y);
+ void prepareContextToDraw();
void printDone();
WebPage* m_webPage;
@@ -83,10 +99,21 @@ protected:
double m_yDPI;
unsigned int m_printPagesIdleId;
+ size_t m_numberOfPagesToPrint;
unsigned int m_pagesToPrint;
+ size_t m_pagePosition;
GtkPageRange* m_pageRanges;
size_t m_pageRangesCount;
bool m_needsRotation;
+
+ // Manual capabilities.
+ unsigned int m_numberUp;
+ unsigned int m_numberUpLayout;
+ unsigned int m_pageSet;
+ bool m_reverse;
+ unsigned int m_copies;
+ bool m_collateCopies;
+ double m_scale;
};
}
diff --git a/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h b/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h
index 2dd065493..806ead9cc 100644
--- a/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h
+++ b/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h
@@ -50,6 +50,7 @@ private:
virtual void setNeedsDisplay(const WebCore::IntRect&) OVERRIDE;
virtual void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset) OVERRIDE;
+ virtual void forceRepaint() OVERRIDE;
virtual void setLayerTreeStateIsFrozen(bool) OVERRIDE;
virtual bool layerTreeStateIsFrozen() const OVERRIDE;
virtual void setRootCompositingLayer(WebCore::GraphicsLayer*) OVERRIDE;
@@ -60,6 +61,7 @@ private:
// Message handlers.
virtual void updateGeometry(const WebCore::IntSize& viewSize) OVERRIDE;
+ virtual void setDeviceScaleFactor(float) OVERRIDE;
void setRootCompositingLayer(CALayer *);
diff --git a/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm b/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
index 9e2849328..26fca92bf 100644
--- a/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
+++ b/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
@@ -114,6 +114,16 @@ void TiledCoreAnimationDrawingArea::setRootCompositingLayer(GraphicsLayer* graph
setRootCompositingLayer(rootCompositingLayer);
}
+void TiledCoreAnimationDrawingArea::forceRepaint()
+{
+ if (m_layerTreeStateIsFrozen)
+ return;
+
+ flushLayers();
+ [CATransaction flush];
+ [CATransaction synchronize];
+}
+
void TiledCoreAnimationDrawingArea::setLayerTreeStateIsFrozen(bool layerTreeStateIsFrozen)
{
if (m_layerTreeStateIsFrozen == layerTreeStateIsFrozen)
@@ -161,6 +171,9 @@ void TiledCoreAnimationDrawingArea::updateGeometry(const IntSize& viewSize)
m_webPage->setSize(viewSize);
m_webPage->layoutIfNeeded();
+ if (!m_layerTreeStateIsFrozen)
+ flushLayers();
+
[CATransaction begin];
[CATransaction setDisableActions:YES];
@@ -174,6 +187,11 @@ void TiledCoreAnimationDrawingArea::updateGeometry(const IntSize& viewSize)
m_webPage->send(Messages::DrawingAreaProxy::DidUpdateGeometry());
}
+void TiledCoreAnimationDrawingArea::setDeviceScaleFactor(float deviceScaleFactor)
+{
+ m_webPage->setDeviceScaleFactor(deviceScaleFactor);
+}
+
void TiledCoreAnimationDrawingArea::setRootCompositingLayer(CALayer *layer)
{
ASSERT(!m_layerTreeStateIsFrozen);
diff --git a/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp b/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp
index fc1e85b21..0005ce8ee 100644
--- a/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp
@@ -52,8 +52,13 @@ PassRefPtr<LayerTreeHostQt> LayerTreeHostQt::create(WebPage* webPage)
LayerTreeHostQt::~LayerTreeHostQt()
{
- if (m_rootLayer)
- toWebGraphicsLayer(m_rootLayer.get())->setLayerTreeTileClient(0);
+ // Prevent setWebGraphicsLayerClient(0) -> detachLayer() from modifying the set while we iterate it.
+ HashSet<WebCore::WebGraphicsLayer*> registeredLayers;
+ registeredLayers.swap(m_registeredLayers);
+
+ HashSet<WebCore::WebGraphicsLayer*>::iterator end = registeredLayers.end();
+ for (HashSet<WebCore::WebGraphicsLayer*>::iterator it = registeredLayers.begin(); it != end; ++it)
+ (*it)->setWebGraphicsLayerClient(0);
}
LayerTreeHostQt::LayerTreeHostQt(WebPage* webPage)
@@ -63,12 +68,12 @@ LayerTreeHostQt::LayerTreeHostQt(WebPage* webPage)
#if USE(TILED_BACKING_STORE)
, m_waitingForUIProcess(false)
, m_isSuspended(false)
+ , m_contentsScale(1)
#endif
, m_shouldSyncFrame(false)
, m_shouldSyncRootLayer(true)
, m_layerFlushTimer(this, &LayerTreeHostQt::layerFlushTimerFired)
, m_layerFlushSchedulingEnabled(true)
- , m_shouldRecreateBackingStore(false)
{
// Create a root layer.
m_rootLayer = GraphicsLayer::create(this);
@@ -83,7 +88,7 @@ LayerTreeHostQt::LayerTreeHostQt(WebPage* webPage)
m_nonCompositedContentLayer = GraphicsLayer::create(this);
#if USE(TILED_BACKING_STORE)
- toWebGraphicsLayer(m_rootLayer.get())->setLayerTreeTileClient(this);
+ toWebGraphicsLayer(m_rootLayer.get())->setWebGraphicsLayerClient(this);
#endif
#ifndef NDEBUG
m_nonCompositedContentLayer->setName("LayerTreeHostQt non-composited content");
@@ -215,8 +220,6 @@ void LayerTreeHostQt::setPageOverlayNeedsDisplay(const WebCore::IntRect& rect)
bool LayerTreeHostQt::flushPendingLayerChanges()
{
- recreateBackingStoreIfNeeded();
-
bool didSync = m_webPage->corePage()->mainFrame()->view()->syncCompositingStateIncludingSubframes();
m_nonCompositedContentLayer->syncCompositingStateForThisLayerOnly();
if (m_pageOverlayLayer)
@@ -232,10 +235,20 @@ void LayerTreeHostQt::didSyncCompositingStateForLayer(const WebLayerInfo& info)
m_webPage->send(Messages::LayerTreeHostProxy::SyncCompositingLayerState(info));
}
-void LayerTreeHostQt::didDeleteLayer(WebLayerID id)
+void LayerTreeHostQt::attachLayer(WebGraphicsLayer* layer)
+{
+ ASSERT(!m_registeredLayers.contains(layer));
+ m_registeredLayers.add(layer);
+
+ layer->setContentsScale(m_contentsScale);
+ layer->adjustVisibleRect();
+}
+
+void LayerTreeHostQt::detachLayer(WebGraphicsLayer* layer)
{
+ m_registeredLayers.remove(layer);
m_shouldSyncFrame = true;
- m_webPage->send(Messages::LayerTreeHostProxy::DeleteCompositingLayer(id));
+ m_webPage->send(Messages::LayerTreeHostProxy::DeleteCompositingLayer(layer->id()));
}
void LayerTreeHostQt::performScheduledLayerFlush()
@@ -321,8 +334,6 @@ int64_t LayerTreeHostQt::adoptImageBackingStore(Image* image)
graphicsContext->drawImage(image, ColorSpaceDeviceRGB, IntPoint::zero());
}
- // Qt uses BGRA internally, we swizzle to RGBA for OpenGL.
- bitmap->swizzleRGB();
ShareableBitmap::Handle handle;
bitmap->createHandle(handle);
m_webPage->send(Messages::LayerTreeHostProxy::CreateDirectlyCompositedImage(key, handle));
@@ -396,22 +407,37 @@ void LayerTreeHostQt::updateTile(WebLayerID layerID, int tileID, const UpdateInf
{
m_webPage->send(Messages::LayerTreeHostProxy::UpdateTileForLayer(layerID, tileID, updateInfo));
}
+
void LayerTreeHostQt::removeTile(WebLayerID layerID, int tileID)
{
m_webPage->send(Messages::LayerTreeHostProxy::RemoveTileForLayer(layerID, tileID));
}
-void LayerTreeHostQt::setVisibleContentRectAndScale(const IntRect& rect, float scale)
+WebCore::IntRect LayerTreeHostQt::visibleContentsRect() const
{
- if (m_rootLayer) {
- toWebGraphicsLayer(m_rootLayer.get())->setVisibleContentRectAndScale(rect, scale);
- scheduleLayerFlush();
+ return m_visibleContentsRect;
+}
+
+void LayerTreeHostQt::setVisibleContentsRectForScaling(const IntRect& rect, float scale)
+{
+ m_visibleContentsRect = rect;
+ m_contentsScale = scale;
+
+ HashSet<WebCore::WebGraphicsLayer*>::iterator end = m_registeredLayers.end();
+ for (HashSet<WebCore::WebGraphicsLayer*>::iterator it = m_registeredLayers.begin(); it != end; ++it) {
+ (*it)->setContentsScale(scale);
+ (*it)->adjustVisibleRect();
}
+ scheduleLayerFlush();
}
-void LayerTreeHostQt::setVisibleContentRectTrajectoryVector(const FloatPoint& trajectoryVector)
+void LayerTreeHostQt::setVisibleContentsRectForPanning(const IntRect& rect, const FloatPoint& trajectoryVector)
{
+ m_visibleContentsRect = rect;
+
toWebGraphicsLayer(m_nonCompositedContentLayer.get())->setVisibleContentRectTrajectoryVector(trajectoryVector);
+
+ scheduleLayerFlush();
}
void LayerTreeHostQt::renderNextFrame()
@@ -427,22 +453,12 @@ bool LayerTreeHostQt::layerTreeTileUpdatesAllowed() const
void LayerTreeHostQt::purgeBackingStores()
{
- m_shouldRecreateBackingStore = true;
- WebGraphicsLayer* webRootLayer = toWebGraphicsLayer(m_rootLayer.get());
- webRootLayer->purgeBackingStores();
+ HashSet<WebCore::WebGraphicsLayer*>::iterator end = m_registeredLayers.end();
+ for (HashSet<WebCore::WebGraphicsLayer*>::iterator it = m_registeredLayers.begin(); it != end; ++it)
+ (*it)->purgeBackingStores();
ASSERT(!m_directlyCompositedImageRefCounts.size());
}
-
-void LayerTreeHostQt::recreateBackingStoreIfNeeded()
-{
- if (!m_shouldRecreateBackingStore)
- return;
-
- m_shouldRecreateBackingStore = false;
- WebGraphicsLayer* webRootLayer = toWebGraphicsLayer(m_rootLayer.get());
- webRootLayer->recreateBackingStoreIfNeeded();
-}
#endif
} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.h b/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.h
index 07f04e88a..f5c433f9a 100644
--- a/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.h
+++ b/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.h
@@ -34,7 +34,7 @@ class WebPage;
class LayerTreeHostQt : public LayerTreeHost, WebCore::GraphicsLayerClient
#if USE(TILED_BACKING_STORE)
- , public WebLayerTreeTileClient
+ , public WebGraphicsLayerClient
#endif
{
public:
@@ -69,13 +69,15 @@ public:
virtual void createTile(WebLayerID, int tileID, const UpdateInfo&);
virtual void updateTile(WebLayerID, int tileID, const UpdateInfo&);
virtual void removeTile(WebLayerID, int tileID);
+ virtual WebCore::IntRect visibleContentsRect() const;
virtual void renderNextFrame();
virtual void purgeBackingStores();
virtual bool layerTreeTileUpdatesAllowed() const;
- virtual void setVisibleContentRectAndScale(const WebCore::IntRect&, float scale);
- virtual void setVisibleContentRectTrajectoryVector(const WebCore::FloatPoint&);
+ virtual void setVisibleContentsRectForScaling(const WebCore::IntRect&, float scale);
+ virtual void setVisibleContentsRectForPanning(const WebCore::IntRect&, const WebCore::FloatPoint&);
virtual void didSyncCompositingStateForLayer(const WebLayerInfo&);
- virtual void didDeleteLayer(WebLayerID);
+ virtual void attachLayer(WebCore::WebGraphicsLayer*);
+ virtual void detachLayer(WebCore::WebGraphicsLayer*);
#endif
protected:
@@ -96,7 +98,6 @@ private:
void cancelPendingLayerFlush();
void performScheduledLayerFlush();
void sendLayersToUI();
- void recreateBackingStoreIfNeeded();
OwnPtr<WebCore::GraphicsLayer> m_rootLayer;
@@ -106,6 +107,7 @@ private:
// The page overlay layer. Will be null if there's no page overlay.
OwnPtr<WebCore::GraphicsLayer> m_pageOverlayLayer;
+ HashSet<WebCore::WebGraphicsLayer*> m_registeredLayers;
HashMap<int64_t, int> m_directlyCompositedImageRefCounts;
bool m_notifyAfterScheduledLayerFlush;
@@ -113,6 +115,8 @@ private:
#if USE(TILED_BACKING_STORE)
bool m_waitingForUIProcess;
bool m_isSuspended;
+ WebCore::IntRect m_visibleContentsRect;
+ float m_contentsScale;
#endif
LayerTreeContext m_layerTreeContext;
bool m_shouldSyncFrame;
@@ -120,7 +124,6 @@ private:
void layerFlushTimerFired(WebCore::Timer<LayerTreeHostQt>*);
WebCore::Timer<LayerTreeHostQt> m_layerFlushTimer;
bool m_layerFlushSchedulingEnabled;
- bool m_shouldRecreateBackingStore;
};
}
diff --git a/Source/WebKit2/WebProcess/WebProcess.cpp b/Source/WebKit2/WebProcess/WebProcess.cpp
index d0981071f..9a8b905fe 100644
--- a/Source/WebKit2/WebProcess/WebProcess.cpp
+++ b/Source/WebKit2/WebProcess/WebProcess.cpp
@@ -100,7 +100,8 @@ static void sleep(unsigned seconds)
}
#endif
-static void* randomCrashThread(void*)
+static void randomCrashThread(void*) NO_RETURN_DUE_TO_CRASH;
+void randomCrashThread(void*)
{
// This delay was chosen semi-arbitrarily. We want the crash to happen somewhat quickly to
// enable useful stress testing, but not so quickly that the web process will always crash soon
@@ -109,7 +110,6 @@ static void* randomCrashThread(void*)
sleep(randomNumber() * maximumRandomCrashDelay);
CRASH();
- return 0;
}
static void startRandomCrashThreadIfRequested()
diff --git a/Source/WebKit2/WebProcess/com.apple.WebProcess.sb b/Source/WebKit2/WebProcess/com.apple.WebProcess.sb
index c706dc8d0..68b073bd8 100644
--- a/Source/WebKit2/WebProcess/com.apple.WebProcess.sb
+++ b/Source/WebKit2/WebProcess/com.apple.WebProcess.sb
@@ -24,6 +24,7 @@
(subpath "/Library/Dictionaries")
(subpath "/Library/Fonts")
(subpath "/Library/Frameworks")
+ (subpath "/Library/Managed Preferences")
(subpath "/private/var/db/mds")
(subpath "/private/var/db/DetachedSignatures")
(regex #"^/private/etc/(hosts|group|passwd)$")
@@ -34,6 +35,7 @@
;; System and user preferences
(literal "/Library/Preferences/.GlobalPreferences.plist")
(literal "/Library/Preferences/com.apple.crypto.plist")
+ (literal "/Library/Preferences/com.apple.networkd.plist")
(literal "/Library/Preferences/com.apple.security.plist")
(literal "/Library/Preferences/com.apple.security.common.plist")
(literal "/Library/Preferences/com.apple.security.revocation.plist")
@@ -45,6 +47,7 @@
(home-literal "/Library/Preferences/com.apple.DownloadAssessment.plist")
(home-literal "/Library/Preferences/com.apple.HIToolbox.plist")
(home-literal "/Library/Preferences/com.apple.LaunchServices.plist")
+ (home-literal "/Library/Preferences/com.apple.QTKit.plist")
(home-literal "/Library/Preferences/com.apple.WebFoundation.plist")
(home-literal "/Library/Preferences/com.apple.security.plist")
(home-literal "/Library/Preferences/com.apple.security.revocation.plist")
diff --git a/Source/WebKit2/WebProcess/efl/WebProcessMainEfl.cpp b/Source/WebKit2/WebProcess/efl/WebProcessMainEfl.cpp
index 83c5c3be2..08f3bb547 100644
--- a/Source/WebKit2/WebProcess/efl/WebProcessMainEfl.cpp
+++ b/Source/WebKit2/WebProcess/efl/WebProcessMainEfl.cpp
@@ -66,7 +66,6 @@ WK_EXPORT int WebProcessMainEfl(int argc, char* argv[])
RunLoop::initializeMainRunLoop();
-#if USE(SOUP)
SoupSession* session = WebCore::ResourceHandle::defaultSession();
const char* httpProxy = g_getenv("http_proxy");
if (httpProxy) {
@@ -77,7 +76,6 @@ WK_EXPORT int WebProcessMainEfl(int argc, char* argv[])
soup_session_add_feature_by_type(session, SOUP_TYPE_CONTENT_SNIFFER);
soup_session_add_feature_by_type(session, SOUP_TYPE_CONTENT_DECODER);
-#endif
int socket = atoi(argv[1]);
WebProcess::shared().initialize(socket, RunLoop::main());
diff --git a/Source/WebKit2/WebProcess/gtk/WebProcessMainGtk.cpp b/Source/WebKit2/WebProcess/gtk/WebProcessMainGtk.cpp
index 18c506bcc..aacc27b6b 100644
--- a/Source/WebKit2/WebProcess/gtk/WebProcessMainGtk.cpp
+++ b/Source/WebKit2/WebProcess/gtk/WebProcessMainGtk.cpp
@@ -58,14 +58,12 @@ WK_EXPORT int WebProcessMainGtk(int argc, char* argv[])
WTF::initializeMainThread();
RunLoop::initializeMainRunLoop();
- SoupSession* session = WebCore::ResourceHandle::defaultSession();
+ int socket = atoi(argv[1]);
+ WebProcess::shared().initialize(socket, RunLoop::main());
- soup_session_add_feature_by_type(session, SOUP_TYPE_CONTENT_SNIFFER);
- soup_session_add_feature_by_type(session, SOUP_TYPE_CONTENT_DECODER);
+ SoupSession* session = WebCore::ResourceHandle::defaultSession();
soup_session_add_feature_by_type(session, WEB_TYPE_AUTH_DIALOG);
- int socket = atoi(argv[1]);
- WebProcess::shared().initialize(socket, RunLoop::main());
RunLoop::run();
return 0;
diff --git a/Source/WebKit2/WebProcess/qt/QtNetworkAccessManager.cpp b/Source/WebKit2/WebProcess/qt/QtNetworkAccessManager.cpp
index 28efc0c82..ce46be854 100644
--- a/Source/WebKit2/WebProcess/qt/QtNetworkAccessManager.cpp
+++ b/Source/WebKit2/WebProcess/qt/QtNetworkAccessManager.cpp
@@ -33,6 +33,7 @@
#include "WebPageProxyMessages.h"
#include "WebProcess.h"
#include <QAuthenticator>
+#include <QNetworkProxy>
#include <QNetworkReply>
#include <QNetworkRequest>
@@ -43,6 +44,7 @@ QtNetworkAccessManager::QtNetworkAccessManager(WebProcess* webProcess)
, m_webProcess(webProcess)
{
connect(this, SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*)), SLOT(onAuthenticationRequired(QNetworkReply*, QAuthenticator*)));
+ connect(this, SIGNAL(proxyAuthenticationRequired(const QNetworkProxy&, QAuthenticator*)), SLOT(onProxyAuthenticationRequired(const QNetworkProxy&, QAuthenticator*)));
connect(this, SIGNAL(sslErrors(QNetworkReply*, QList<QSslError>)), SLOT(onSslErrors(QNetworkReply*, QList<QSslError>)));
}
@@ -73,6 +75,31 @@ void QtNetworkAccessManager::registerApplicationScheme(const WebPage* page, cons
m_applicationSchemes.insert(page, scheme.toLower());
}
+void QtNetworkAccessManager::onProxyAuthenticationRequired(const QNetworkProxy& proxy, QAuthenticator* authenticator)
+{
+ // FIXME: Check if there is a better way to get a reference to the page.
+ WebPage* webPage = m_webProcess->focusedWebPage();
+
+ if (!webPage)
+ return;
+
+ String hostname = proxy.hostName();
+ uint16_t port = static_cast<uint16_t>(proxy.port());
+ String prefilledUsername = authenticator->user();
+ String username;
+ String password;
+
+ if (webPage->sendSync(
+ Messages::WebPageProxy::ProxyAuthenticationRequiredRequest(hostname, port, prefilledUsername),
+ Messages::WebPageProxy::ProxyAuthenticationRequiredRequest::Reply(username, password))) {
+ if (!username.isEmpty())
+ authenticator->setUser(username);
+ if (!password.isEmpty())
+ authenticator->setPassword(password);
+ }
+
+}
+
void QtNetworkAccessManager::onAuthenticationRequired(QNetworkReply* reply, QAuthenticator* authenticator)
{
WebPage* webPage = obtainOriginatingWebPage(reply->request());
diff --git a/Source/WebKit2/WebProcess/qt/QtNetworkAccessManager.h b/Source/WebKit2/WebProcess/qt/QtNetworkAccessManager.h
index 846221eb7..fe37bda1f 100644
--- a/Source/WebKit2/WebProcess/qt/QtNetworkAccessManager.h
+++ b/Source/WebKit2/WebProcess/qt/QtNetworkAccessManager.h
@@ -29,6 +29,7 @@
#include <QMultiHash>
#include <QNetworkAccessManager>
+#include <QNetworkProxy>
#include <QString>
namespace WebKit {
@@ -47,6 +48,7 @@ protected:
private Q_SLOTS:
void onAuthenticationRequired(QNetworkReply *, QAuthenticator *);
+ void onProxyAuthenticationRequired(const QNetworkProxy&, QAuthenticator *);
void onSslErrors(QNetworkReply*, const QList<QSslError>&);
private:
diff --git a/Source/WebKit2/win/WebKit2.def b/Source/WebKit2/win/WebKit2.def
index 76830e01c..718dfa18b 100644
--- a/Source/WebKit2/win/WebKit2.def
+++ b/Source/WebKit2/win/WebKit2.def
@@ -116,6 +116,7 @@ EXPORTS
?broadcast@ThreadCondition@WTF@@QAEXXZ
?callOnMainThread@WTF@@YAXP6AXPAX@Z0@Z
?createThread@WTF@@YAIP6APAXPAX@Z0PBD@Z
+ ?createThread@WTF@@YAIP6AXPAX@Z0PBD@Z
?currentThread@WTF@@YAIXZ
?detachThread@WTF@@YAXI@Z
?initializeMainThread@WTF@@YAXXZ
@@ -131,6 +132,7 @@ EXPORTS
?unlock@Mutex@WTF@@QAEXXZ
?unlockAtomicallyInitializedStaticMutex@WTF@@YAXXZ
?wait@ThreadCondition@WTF@@QAEXAAVMutex@2@@Z
+ ?waitForThreadCompletion@WTF@@YAHI@Z
?waitForThreadCompletion@WTF@@YAHIPAPAX@Z
?createThread@WTF@@YAIP6APAXPAX@Z0@Z
; Re-exports from WebCore for test harnesses
@@ -163,13 +165,14 @@ EXPORTS
?getData16SlowCase@StringImpl@WTF@@ABEPB_WXZ
?getElementById@TreeScope@WebCore@@QBEPAVElement@2@ABVAtomicString@WTF@@@Z
?getLocationAndLengthFromRange@TextIterator@WebCore@@SA_NPAVElement@2@PBVRange@2@AAI2@Z
+ ?hasShadowRoot@Element@WebCore@@QBE_NXZ
?isPreloaded@CachedResourceLoader@WebCore@@QBE_NABVString@WTF@@@Z
?jsStringSlowCase@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@AAV?$HashMap@PAVStringImpl@WTF@@V?$Weak@VJSString@JSC@@@JSC@@UStringHash@2@U?$HashTraits@PAVStringImpl@WTF@@@2@U?$HashTraits@V?$Weak@VJSString@JSC@@@JSC@@@2@@WTF@@PAVStringImpl@6@@Z
?lastChangeWasUserEdit@HTMLTextFormControlElement@WebCore@@QBE_NXZ
?markersFor@DocumentMarkerController@WebCore@@QAE?AV?$Vector@PAVDocumentMarker@WebCore@@$0A@@WTF@@PAVNode@2@VMarkerTypes@DocumentMarker@2@@Z
?observeFrame@FrameDestructionObserver@WebCore@@IAEXPAVFrame@2@@Z
?overrideUserPreferredLanguages@WebCore@@YAXABV?$Vector@VString@WTF@@$0A@@WTF@@@Z
- ; ?numberOfScopedHTMLStyleChildren@Element@WebCore@@QBEIXZ
+ ?numberOfScopedHTMLStyleChildren@Node@WebCore@@QBEIXZ
?page@Document@WebCore@@QBEPAVPage@2@XZ
?paintControlTints@FrameView@WebCore@@AAEXXZ
?rangeFromLocationAndLength@TextIterator@WebCore@@SA?AV?$PassRefPtr@VRange@WebCore@@@WTF@@PAVElement@2@HH_N@Z
@@ -187,7 +190,7 @@ EXPORTS
?settings@Document@WebCore@@QBEPAVSettings@2@XZ
?settings@Frame@WebCore@@QBEPAVSettings@2@XZ
?setFixedElementsLayoutRelativeToFrame@Settings@WebCore@@QAEX_N@Z
- ?shadowRoot@Element@WebCore@@QBEPAVShadowRoot@2@XZ
+ ?shadowRootList@Element@WebCore@@QBEPAVShadowRootList@2@XZ
?suggestedValue@HTMLInputElement@WebCore@@QBEABVString@WTF@@XZ
?toDocument@WebCore@@YAPAVDocument@1@VJSValue@JSC@@@Z
?toElement@WebCore@@YAPAVElement@1@VJSValue@JSC@@@Z
@@ -198,3 +201,4 @@ EXPORTS
?updateLayoutIgnorePendingStylesheets@Document@WebCore@@QAEXXZ
?userPreferredLanguages@WebCore@@YA?AV?$Vector@VString@WTF@@$0A@@WTF@@XZ
?view@Document@WebCore@@QBEPAVFrameView@2@XZ
+ ?willDetachPage@FrameDestructionObserver@WebCore@@UAEXXZ
diff --git a/Source/WebKit2/win/WebKit2CFLite.def b/Source/WebKit2/win/WebKit2CFLite.def
index 3a927c27c..c359ea6e3 100644
--- a/Source/WebKit2/win/WebKit2CFLite.def
+++ b/Source/WebKit2/win/WebKit2CFLite.def
@@ -109,6 +109,7 @@ EXPORTS
?broadcast@ThreadCondition@WTF@@QAEXXZ
?callOnMainThread@WTF@@YAXP6AXPAX@Z0@Z
?createThread@WTF@@YAIP6APAXPAX@Z0PBD@Z
+ ?createThread@WTF@@YAIP6AXPAX@Z0PBD@Z
?currentThread@WTF@@YAIXZ
?detachThread@WTF@@YAXI@Z
?initializeMainThread@WTF@@YAXXZ
@@ -124,9 +125,9 @@ EXPORTS
?unlock@Mutex@WTF@@QAEXXZ
?unlockAtomicallyInitializedStaticMutex@WTF@@YAXXZ
?wait@ThreadCondition@WTF@@QAEXAAVMutex@2@@Z
+ ?waitForThreadCompletion@WTF@@YAHI@Z
?waitForThreadCompletion@WTF@@YAHIPAPAX@Z
?createThread@WTF@@YAIP6APAXPAX@Z0@Z
-
; Re-exports from WebCore for test harnesses
??0NodeRenderingContext@WebCore@@QAE@PAVNode@1@@Z
??1NodeRenderingContext@WebCore@@QAE@XZ
@@ -157,13 +158,14 @@ EXPORTS
?getData16SlowCase@StringImpl@WTF@@ABEPB_WXZ
?getElementById@TreeScope@WebCore@@QBEPAVElement@2@ABVAtomicString@WTF@@@Z
?getLocationAndLengthFromRange@TextIterator@WebCore@@SA_NPAVElement@2@PBVRange@2@AAI2@Z
+ ?hasShadowRoot@Element@WebCore@@QBE_NXZ
?isPreloaded@CachedResourceLoader@WebCore@@QBE_NABVString@WTF@@@Z
?jsStringSlowCase@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@AAV?$HashMap@PAVStringImpl@WTF@@V?$Weak@VJSString@JSC@@@JSC@@UStringHash@2@U?$HashTraits@PAVStringImpl@WTF@@@2@U?$HashTraits@V?$Weak@VJSString@JSC@@@JSC@@@2@@WTF@@PAVStringImpl@6@@Z
?lastChangeWasUserEdit@HTMLTextFormControlElement@WebCore@@QBE_NXZ
?markersFor@DocumentMarkerController@WebCore@@QAE?AV?$Vector@PAVDocumentMarker@WebCore@@$0A@@WTF@@PAVNode@2@VMarkerTypes@DocumentMarker@2@@Z
?observeFrame@FrameDestructionObserver@WebCore@@IAEXPAVFrame@2@@Z
?overrideUserPreferredLanguages@WebCore@@YAXABV?$Vector@VString@WTF@@$0A@@WTF@@@Z
- ; ?numberOfScopedHTMLStyleChildren@Element@WebCore@@QBEIXZ
+ ?numberOfScopedHTMLStyleChildren@Node@WebCore@@QBEIXZ
?page@Document@WebCore@@QBEPAVPage@2@XZ
?paintControlTints@FrameView@WebCore@@AAEXXZ
?rangeFromLocationAndLength@TextIterator@WebCore@@SA?AV?$PassRefPtr@VRange@WebCore@@@WTF@@PAVElement@2@HH_N@Z
@@ -181,7 +183,7 @@ EXPORTS
?settings@Document@WebCore@@QBEPAVSettings@2@XZ
?settings@Frame@WebCore@@QBEPAVSettings@2@XZ
?setFixedElementsLayoutRelativeToFrame@Settings@WebCore@@QAEX_N@Z
- ?shadowRoot@Element@WebCore@@QBEPAVShadowRoot@2@XZ
+ ?shadowRootList@Element@WebCore@@QBEPAVShadowRootList@2@XZ
?suggestedValue@HTMLInputElement@WebCore@@QBEABVString@WTF@@XZ
?toDocument@WebCore@@YAPAVDocument@1@VJSValue@JSC@@@Z
?toElement@WebCore@@YAPAVElement@1@VJSValue@JSC@@@Z
@@ -192,3 +194,4 @@ EXPORTS
?updateLayoutIgnorePendingStylesheets@Document@WebCore@@QAEXXZ
?userPreferredLanguages@WebCore@@YA?AV?$Vector@VString@WTF@@$0A@@WTF@@XZ
?view@Document@WebCore@@QBEPAVFrameView@2@XZ
+ ?willDetachPage@FrameDestructionObserver@WebCore@@UAEXXZ