diff options
Diffstat (limited to 'Source/WebKit2')
48 files changed, 731 insertions, 138 deletions
diff --git a/Source/WebKit2/CMakeLists.txt b/Source/WebKit2/CMakeLists.txt index 1da9a6ac8..c8d1c35fc 100644 --- a/Source/WebKit2/CMakeLists.txt +++ b/Source/WebKit2/CMakeLists.txt @@ -55,6 +55,7 @@ SET(WebKit2_INCLUDE_DIRECTORIES "${WEBCORE_DIR}/editing" "${WEBCORE_DIR}/history" "${WEBCORE_DIR}/html" + "${WEBCORE_DIR}/html/shadow" "${WEBCORE_DIR}/html/track" "${WEBCORE_DIR}/inspector" "${WEBCORE_DIR}/loader" diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog index f9f6f1d91..42222d87c 100644 --- a/Source/WebKit2/ChangeLog +++ b/Source/WebKit2/ChangeLog @@ -1,3 +1,355 @@ +2012-07-18 Zeno Albisser <zeno@webkit.org> + + [Qt][WK2] Caching of ShareableSurfaces breaks tiling. + https://bugs.webkit.org/show_bug.cgi?id=91609 + + A ShareableSurface should only be cached, + when it is GraphicsSurface based. + + Reviewed by Kenneth Rohde Christiansen. + + * UIProcess/LayerTreeCoordinatorProxy.cpp: + (WebKit::LayerTreeCoordinatorProxy::updateTileForLayer): + * UIProcess/LayerTreeCoordinatorProxy.h: + (LayerTreeCoordinatorProxy): + +2012-07-18 Carlos Garcia Campos <cgarcia@igalia.com> + + [GTK] Fix a crash due to an invalid assert + https://bugs.webkit.org/show_bug.cgi?id=91614 + + Reviewed by Xan Lopez. + + In webkitWebViewBaseContainerAdd() there's + ASSERT(priv->inspectorView); that should be the opposite, since we + shoulnd't have an inspector view when the inspector view is added. + + * UIProcess/API/gtk/WebKitWebViewBase.cpp: + (webkitWebViewBaseContainerAdd): + +2012-07-18 Thiago Marcos P. Santos <thiago.santos@intel.com> + + [CMake] Make gtest a shared library + https://bugs.webkit.org/show_bug.cgi?id=90973 + + Reviewed by Daniel Bates. + + No need to link with gtest dependencies now since it is a shared library. + + * PlatformEfl.cmake: + +2012-07-18 YoungTaeck Song <youngtaeck.song@samsung.com> + + [WK2][EFL] Add a common code using Color instead of QColor + https://bugs.webkit.org/show_bug.cgi?id=91580 + + Reviewed by Simon Hausmann. + + This patch is a subset of Efl's UI_SIDE_COMPOSITING implementation. + drawBorder's argument is QColor. So add a common code using Color to be used by Efl. + + * UIProcess/texmap/LayerBackingStore.cpp: + (WebKit::LayerBackingStore::paintToTextureMapper): + +2012-07-17 Christophe Dumez <christophe.dumez@intel.com> + + [EFL] Replace 0 by NULL in public headers documentation + https://bugs.webkit.org/show_bug.cgi?id=91470 + + Reviewed by Dirk Pranke. + + Use NULL instead of 0 for pointer types in public + C headers. + + * UIProcess/API/efl/ewk_intent.h: + * UIProcess/API/efl/ewk_intent_service.h: + * UIProcess/API/efl/ewk_url_request.h: + * UIProcess/API/efl/ewk_url_response.h: + * UIProcess/API/efl/ewk_view.h: + * UIProcess/API/efl/ewk_web_resource.h: + +2012-07-17 Carlos Garcia Campos <cgarcia@igalia.com> + + [GTK] Don't use deprecated soup API in WebKit2APITests/TestResources + https://bugs.webkit.org/show_bug.cgi?id=91496 + + Reviewed by Martin Robinson. + + soup_message_headers_get() is deprecated, use + soup_message_headers_get_one() instead. + + * UIProcess/API/gtk/tests/TestResources.cpp: + (serverCallback): + +2012-07-17 Carlos Garcia Campos <cgarcia@igalia.com> + + [GTK] Fix a typo in WebKit2APITests/TestResources + https://bugs.webkit.org/show_bug.cgi?id=91495 + + Reviewed by Xan Lopez. + + * UIProcess/API/gtk/tests/TestResources.cpp: + (testWebResourceLoading): + (testWebResourceResponse): + (testWebResourceMimeType): + (testWebResourceActiveURI): + +2012-07-17 Vivek Galatage <vivekgalatage@gmail.com> + + Web Inspector: refactor InspectorController::connectFrontend() to accept InspectorFrontendChannel. + https://bugs.webkit.org/show_bug.cgi?id=91196 + + Reviewed by Pavel Feldman. + + Refactoring InspectorClients. InspectorClient::openInspectorFrontend + now returning the InspectorFrontendChannel. + + * WebProcess/WebCoreSupport/WebInspectorClient.cpp: + (WebKit::WebInspectorClient::openInspectorFrontend): + * WebProcess/WebCoreSupport/WebInspectorClient.h: + (WebInspectorClient): + +2012-07-17 Carlos Garcia Campos <cgarcia@igalia.com> + + [GTK] Paste primary selection when middle clicking in X11 WebKit2 + https://bugs.webkit.org/show_bug.cgi?id=91411 + + Reviewed by Xan Lopez. + + Handle middle click events to paste primary selection as expected + in any X11 application. + + * WebProcess/WebPage/WebPage.cpp: + (WebKit::handleMouseEvent): Call handleMousePressedEvent() for GTK+ + platform. + * WebProcess/WebPage/WebPage.h: + (WebPage): Add handleMousePressedEvent() for GTK+ platform. + * WebProcess/WebPage/gtk/WebPageGtk.cpp: + (WebKit::WebPage::handleMousePressedEvent): Handle middle click + events to paste primary selection like we do in WebKit1. + +2012-07-17 Ryuan Choi <ryuan.choi@samsung.com> + + [EFL] Move codes related to theme setting from Widget to RenderTheme + https://bugs.webkit.org/show_bug.cgi?id=89842 + + Reviewed by Kenneth Rohde Christiansen. + + * CMakeLists.txt: Added html/shadow to WebKit_INCLUDE_DIRECTORIES. + * WebProcess/WebPage/efl/WebPageEfl.cpp: + (WebKit::WebPage::setThemePath): Called RenderThemeEfl::setThemePath instead of setting theme in FrameView. + +2012-07-17 David Barr <davidbarr@chromium.org> + + Introduce ENABLE_CSS_IMAGE_ORIENTATION compile flag + https://bugs.webkit.org/show_bug.cgi?id=89055 + + Reviewed by Kent Tamura. + + The css3-images module is at candidate recommendation. + http://www.w3.org/TR/2012/CR-css3-images-20120417/#the-image-orientation + + Add a configuration option for CSS image-orientation support, disabling it by default. + + * Configurations/FeatureDefines.xcconfig: + +2012-07-16 Gyuyoung Kim <gyuyoung.kim@samsung.com> + + Add RegisterProtocolHandlerClient to the Modules/protocolhandler + https://bugs.webkit.org/show_bug.cgi?id=90940 + + Reviewed by Hajime Morita. + + As a step to let protocol handler be moved to the modules, RegisterProtocolHandlerClient needs + to be added to the Modules/protocolhandler. Because ChromeClient has some virtual functions for + protocol handlers, virtual functions should be moved to RegisterProtocolHandlerClient. + + In order to support this, WebRegisterProtocolHandlerClient class is added. However, this is not implemented yet. + In addition, existing virtual functions in WebChromeClient are moved to WebRegisterProtocolHandlerClient. + + * WebProcess/WebCoreSupport/WebChromeClient.h: + * WebProcess/WebCoreSupport/WebRegisterProtocolHandlerClient.h: Added. + (WebKit): + (WebRegisterProtoclHandlerClient): + (WebKit::WebRegisterProtoclHandlerClient::isProtocolHandlerRegistered): + (WebKit::WebRegisterProtoclHandlerClient::unregisterProtocolHandler): + +2012-07-16 Pete Williamson <petewil@google.com> + + Export the iconURL list to make it available to the Internals class for testing + https://bugs.webkit.org/show_bug.cgi?id=88665 + + Reviewed by Kent Tamura. + + * win/WebKit2.def: export the DocumentL::iconURLs function + +2012-07-16 Hajime Morrita <morrita@chromium.org> + + WebCore needs WEBCORE_TESTING macro to mark methods being exported for testing. + https://bugs.webkit.org/show_bug.cgi?id=90764 + + Reviewed by Adam Barth. + + Removed symbols which are now covered by WEBCORE_TESTING. + + * win/WebKit2.def: + * win/WebKit2CFLite.def: + +2012-07-16 Christophe Dumez <christophe.dumez@intel.com> + + [EFL][WK2] Implement decidePolicyForResponse in policy client + https://bugs.webkit.org/show_bug.cgi?id=91401 + + Reviewed by Kenneth Rohde Christiansen. + + Provide implementation for decidePolicyForResponse callback + in WebKit2 EFL's policy client. + + * UIProcess/API/efl/ewk_view_policy_client.cpp: + (decidePolicyForResponseCallback): + (ewk_view_policy_client_attach): + +2012-07-16 Ryuan Choi <ryuan.choi@samsung.com> + + [EFL][WK2] Add APIs to support theme. + https://bugs.webkit.org/show_bug.cgi?id=90107 + + Reviewed by Hajime Morita. + + RenderThemeEfl uses edj file to render native theme of form elements. + This patch provides default theme and a way to change edj theme file for + WebKit2/Efl. + + * PlatformEfl.cmake: + * UIProcess/API/efl/ewk_view.cpp: + (_Ewk_View_Private_Data): + (ewk_view_base_add): + (ewk_view_theme_set): + (ewk_view_theme_get): + * UIProcess/API/efl/ewk_view.h: + * UIProcess/WebPageProxy.h: + (WebPageProxy): + * UIProcess/efl/WebPageProxyEfl.cpp: + (WebKit::WebPageProxy::setThemePath): + * WebProcess/WebPage/WebPage.h: + * WebProcess/WebPage/WebPage.messages.in: + * WebProcess/WebPage/efl/WebPageEfl.cpp: + (WebKit::WebPage::setThemePath): + +2012-07-16 Kihong Kwon <kihong.kwon@samsung.com> + + Remove setController from BatteryClient + https://bugs.webkit.org/show_bug.cgi?id=90944 + + Reviewed by Adam Barth. + + Remove WebBatteryClient::setController function. + + * WebProcess/WebCoreSupport/WebBatteryClient.cpp: + * WebProcess/WebCoreSupport/WebBatteryClient.h: + (WebBatteryClient): + +2012-07-16 Christophe Dumez <christophe.dumez@intel.com> + + [EFL][WK2] Make Ewk_Navigation_Policy_Decision ref counted + https://bugs.webkit.org/show_bug.cgi?id=91343 + + Reviewed by Antonio Gomes. + + Make Ewk_Navigation_Policy_Decision ref counted so that the + client can make navigation policy decisions asynchronously + by ref'ing the Ewk_Navigation_Policy_Decision object passed + with the "policy,*" signals. + + * UIProcess/API/efl/ewk_navigation_policy_decision.cpp: + (_Ewk_Navigation_Policy_Decision): + (_Ewk_Navigation_Policy_Decision::_Ewk_Navigation_Policy_Decision): + (_Ewk_Navigation_Policy_Decision::~_Ewk_Navigation_Policy_Decision): + (ewk_navigation_policy_decision_ref): + (ewk_navigation_policy_decision_unref): + * UIProcess/API/efl/ewk_navigation_policy_decision.h: + * UIProcess/API/efl/ewk_view.h: + * UIProcess/API/efl/ewk_view_policy_client.cpp: + (decidePolicyForNavigationAction): + (decidePolicyForNewWindowAction): + +2012-07-16 Zoltan Horvath <zoltan@webkit.org> + + [Qt] Change NativeImagePtr from QPixmap* to QImage* + https://bugs.webkit.org/show_bug.cgi?id=88785 + + Reviewed by Simon Hausmann. + + Since we use raster engine there is no difference between QPixmap and QImage, so we are going + to use QImage everywhere where it is possible. This refactoring contains the change of the + NativeImagePtr typedef from QPixmap* to QImage* and covers the related modifications. + + Part of the change is similar to Viatcheslav Ostapenko's internal work. + + Covered by existing tests. + + * Shared/qt/ShareableBitmapQt.cpp: + (WebKit::ShareableBitmap::createImage): + * UIProcess/qt/QtWebIconDatabaseClient.cpp: + (WebKit::QtWebIconDatabaseClient::iconImageForPageURL): + * WebProcess/WebCoreSupport/qt/WebDragClientQt.cpp: + (WebKit::convertQImageToShareableBitmap): + (WebKit::WebDragClient::startDrag): + * WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.cpp: + (WebKit::LayerTreeCoordinator::adoptImageBackingStore): + +2012-07-16 Carlos Garcia Campos <cgarcia@igalia.com> + + Unreviewed. Fix make distcheck. + + * UIProcess/API/gtk/tests/GNUmakefile.am: Add test resources to + EXTRA_DIST. + +2012-07-15 Christophe Dumez <christophe.dumez@intel.com> + + [EFL][WK2] Define destructors for Ewk structures + https://bugs.webkit.org/show_bug.cgi?id=91338 + + Reviewed by Kentaro Hara. + + Add destructors to Ewk structures and move + memory freeing code from *_free() or *_unref() + functions to the destructors. + + * UIProcess/API/efl/ewk_intent.cpp: + (_Ewk_Intent::_Ewk_Intent): + (_Ewk_Intent): + (_Ewk_Intent::~_Ewk_Intent): + (ewk_intent_unref): + * UIProcess/API/efl/ewk_intent_service.cpp: + (_Ewk_Intent_Service): + (_Ewk_Intent_Service::~_Ewk_Intent_Service): + (ewk_intent_service_unref): + * UIProcess/API/efl/ewk_navigation_policy_decision.cpp: + (_Ewk_Navigation_Policy_Decision): + (_Ewk_Navigation_Policy_Decision::~_Ewk_Navigation_Policy_Decision): + (ewk_navigation_policy_decision_free): + * UIProcess/API/efl/ewk_url_request.cpp: + (_Ewk_Url_Request): + (_Ewk_Url_Request::~_Ewk_Url_Request): + (ewk_url_request_unref): + * UIProcess/API/efl/ewk_url_response.cpp: + (_Ewk_Url_Response): + (_Ewk_Url_Response::~_Ewk_Url_Response): + (ewk_url_response_unref): + * UIProcess/API/efl/ewk_view.cpp: + (_Ewk_View_Private_Data): + (_Ewk_View_Private_Data::~_Ewk_View_Private_Data): + (_ewk_view_priv_del): + * UIProcess/API/efl/ewk_web_error.cpp: + (_Ewk_Web_Error): + (_Ewk_Web_Error::~_Ewk_Web_Error): + (ewk_web_error_free): + * UIProcess/API/efl/ewk_web_resource.cpp: + (_Ewk_Web_Resource): + (_Ewk_Web_Resource::~_Ewk_Web_Resource): + (ewk_web_resource_unref): + 2012-07-14 Eric Carlson <eric.carlson@apple.com> Enable AVCF hardware video decoding diff --git a/Source/WebKit2/Configurations/FeatureDefines.xcconfig b/Source/WebKit2/Configurations/FeatureDefines.xcconfig index 7f95c3018..1fc82597c 100644 --- a/Source/WebKit2/Configurations/FeatureDefines.xcconfig +++ b/Source/WebKit2/Configurations/FeatureDefines.xcconfig @@ -42,6 +42,7 @@ ENABLE_CSS_BOX_DECORATION_BREAK = ENABLE_CSS_BOX_DECORATION_BREAK; ENABLE_CSS_EXCLUSIONS = ENABLE_CSS_EXCLUSIONS; ENABLE_CSS_FILTERS = ENABLE_CSS_FILTERS; ENABLE_CSS_SHADERS = ENABLE_CSS_SHADERS; +ENABLE_CSS_IMAGE_ORIENTATION = ; ENABLE_CSS_IMAGE_RESOLUTION = ; ENABLE_CSS_REGIONS = ENABLE_CSS_REGIONS; ENABLE_CSS_VARIABLES = ; @@ -134,4 +135,4 @@ ENABLE_WEB_TIMING = ; ENABLE_WORKERS = ENABLE_WORKERS; ENABLE_XSLT = ENABLE_XSLT; -FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS3_FLEXBOX) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_VARIABLES) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_TAG) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_TAG) $(ENABLE_QUOTA) $(ENABLE_REGISTER_PROTOCOL_HANDLER) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_UNDO_MANAGER) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XSLT); +FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS3_FLEXBOX) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_VARIABLES) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_TAG) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_TAG) $(ENABLE_QUOTA) $(ENABLE_REGISTER_PROTOCOL_HANDLER) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_UNDO_MANAGER) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XSLT); diff --git a/Source/WebKit2/Configurations/Version.xcconfig b/Source/WebKit2/Configurations/Version.xcconfig index d0b2d142f..c2637aa45 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 = 537; -MINOR_VERSION = 1; +MINOR_VERSION = 2; TINY_VERSION = 0; FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION); diff --git a/Source/WebKit2/PlatformEfl.cmake b/Source/WebKit2/PlatformEfl.cmake index 9870e0e2e..db0e45914 100644 --- a/Source/WebKit2/PlatformEfl.cmake +++ b/Source/WebKit2/PlatformEfl.cmake @@ -156,6 +156,8 @@ LIST (APPEND WebProcess_LIBRARIES ${SQLITE_LIBRARIES} ) +ADD_DEFINITIONS(-DDEFAULT_THEME_PATH=\"${CMAKE_INSTALL_PREFIX}/${DATA_INSTALL_DIR}/themes\") + ADD_CUSTOM_TARGET(forwarding-headerEfl COMMAND ${PERL_EXECUTABLE} ${WEBKIT2_DIR}/Scripts/generate-forwarding-headers.pl ${WEBKIT2_DIR} ${DERIVED_SOURCES_WEBKIT2_DIR}/include efl ) @@ -186,12 +188,14 @@ INSTALL(FILES ${EWebKit2_HEADERS} DESTINATION include/${WebKit2_LIBRARY_NAME}-${ INCLUDE_DIRECTORIES(${THIRDPARTY_DIR}/gtest/include) SET(EWK2UnitTests_LIBRARIES + ${WTF_LIBRARY_NAME} ${JavaScriptCore_LIBRARY_NAME} ${WebCore_LIBRARY_NAME} ${WebKit2_LIBRARY_NAME} ${ECORE_LIBRARIES} ${ECORE_EVAS_LIBRARIES} ${EVAS_LIBRARIES} + gtest ) IF (ENABLE_GLIB_SUPPORT) @@ -204,7 +208,9 @@ ENDIF() SET(WEBKIT2_EFL_TEST_DIR "${WEBKIT2_DIR}/UIProcess/API/efl/tests") SET(TEST_RESOURCES_DIR ${WEBKIT2_EFL_TEST_DIR}/resources) -ADD_DEFINITIONS(-DTEST_RESOURCES_DIR=\"${TEST_RESOURCES_DIR}\") +ADD_DEFINITIONS(-DTEST_RESOURCES_DIR=\"${TEST_RESOURCES_DIR}\" + -DGTEST_LINKED_AS_SHARED_LIBRARY=1 +) ADD_LIBRARY(ewk2UnitTestUtils ${WEBKIT2_EFL_TEST_DIR}/UnitTestUtils/EWK2UnitTestBase.cpp @@ -225,6 +231,6 @@ IF (ENABLE_API_TESTS) ADD_EXECUTABLE(${testName} ${WEBKIT2_EFL_TEST_DIR}/${testName}.cpp) ADD_TEST(${testName} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${testName}) SET_TESTS_PROPERTIES(${testName} PROPERTIES TIMEOUT 60) - TARGET_LINK_LIBRARIES(${testName} ${EWK2UnitTests_LIBRARIES} ewk2UnitTestUtils gtest pthread) + TARGET_LINK_LIBRARIES(${testName} ${EWK2UnitTests_LIBRARIES} ewk2UnitTestUtils) ENDFOREACH () ENDIF () diff --git a/Source/WebKit2/Shared/qt/ShareableBitmapQt.cpp b/Source/WebKit2/Shared/qt/ShareableBitmapQt.cpp index a7ab8d4b3..b6ceb3e15 100644 --- a/Source/WebKit2/Shared/qt/ShareableBitmapQt.cpp +++ b/Source/WebKit2/Shared/qt/ShareableBitmapQt.cpp @@ -52,8 +52,8 @@ void ShareableBitmap::releaseSharedMemoryData(void* typelessBitmap) PassRefPtr<Image> ShareableBitmap::createImage() { - QPixmap* pixmap = new QPixmap(QPixmap::fromImage(createQImage())); - return BitmapImage::create(pixmap); + QImage* image = new QImage(createQImage()); + return BitmapImage::create(image); } PassOwnPtr<GraphicsContext> ShareableBitmap::createGraphicsContext() diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_intent.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_intent.cpp index ba923ee0b..7322108be 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_intent.cpp +++ b/Source/WebKit2/UIProcess/API/efl/ewk_intent.cpp @@ -59,7 +59,14 @@ struct _Ewk_Intent { , action(0) , type(0) , service(0) + { } + + ~_Ewk_Intent() { + ASSERT(!__ref); + eina_stringshare_del(action); + eina_stringshare_del(type); + eina_stringshare_del(service); } }; @@ -90,9 +97,6 @@ void ewk_intent_unref(Ewk_Intent* intent) if (--intent->__ref) return; - eina_stringshare_del(intent->action); - eina_stringshare_del(intent->type); - eina_stringshare_del(intent->service); delete intent; #endif } diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_intent.h b/Source/WebKit2/UIProcess/API/efl/ewk_intent.h index fdcfe00d4..ae73c6ce5 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_intent.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_intent.h @@ -50,7 +50,7 @@ EAPI void ewk_intent_ref(Ewk_Intent *intent); /** * Decreases the reference count of the given object, possibly freeing it. * - * When the reference count it's reached 0, the intent is freed. + * When the reference count reaches 0, the intent is freed. * * @param intent the intent object to decrease the reference count */ @@ -103,7 +103,7 @@ EAPI const char *ewk_intent_service_get(const Ewk_Intent *intent); * * @param intent intent item to query. * - * @return @c Eina_List with suggested service URLs on success, or @c 0 on failure, + * @return @c Eina_List with suggested service URLs on success, or @c NULL on failure, * the Eina_List and its items should be freed after use. Use free() to free the * items. */ @@ -124,7 +124,7 @@ EAPI char *ewk_intent_extra_get(const Ewk_Intent *intent, const char *key); * * @param intent intent item to query. * - * @return @c Eina_List with names of extra metadata on success, or @c 0 on failure, + * @return @c Eina_List with names of extra metadata on success, or @c NULL on failure, * the Eina_List and its items should be freed after use. Use free() to free the * items. */ diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_intent_service.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_intent_service.cpp index 9395f421f..18422b757 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_intent_service.cpp +++ b/Source/WebKit2/UIProcess/API/efl/ewk_intent_service.cpp @@ -62,6 +62,16 @@ struct _Ewk_Intent_Service { , title(0) , disposition(0) { } + + ~_Ewk_Intent_Service() + { + ASSERT(!__ref); + eina_stringshare_del(action); + eina_stringshare_del(type); + eina_stringshare_del(href); + eina_stringshare_del(title); + eina_stringshare_del(disposition); + } }; #define EWK_INTENT_SERVICE_WK_GET_OR_RETURN(service, wkService_, ...) \ @@ -91,11 +101,6 @@ void ewk_intent_service_unref(Ewk_Intent_Service* service) if (--service->__ref) return; - eina_stringshare_del(service->action); - eina_stringshare_del(service->type); - eina_stringshare_del(service->href); - eina_stringshare_del(service->title); - eina_stringshare_del(service->disposition); delete service; #endif } diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_intent_service.h b/Source/WebKit2/UIProcess/API/efl/ewk_intent_service.h index de22f6c4c..958e05448 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_intent_service.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_intent_service.h @@ -50,7 +50,7 @@ EAPI void ewk_intent_service_ref(Ewk_Intent_Service *service); /** * Decreases the reference count of the given object, possibly freeing it. * - * When the reference count it's reached 0, the intent service is freed. + * When the reference count reaches 0, the intent service is freed. * * @param service the intent service object to decrease the reference count */ diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision.cpp index a21649d34..ae725d74a 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision.cpp +++ b/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision.cpp @@ -40,6 +40,7 @@ using namespace WebKit; * @brief Contains the navigation policy decision data. */ struct _Ewk_Navigation_Policy_Decision { + unsigned int __ref; /**< the reference count of the object */ WKRetainPtr<WKFramePolicyListenerRef> listener; bool actedUponByClient; Ewk_Navigation_Type navigationType; @@ -49,7 +50,8 @@ struct _Ewk_Navigation_Policy_Decision { const char* frameName; _Ewk_Navigation_Policy_Decision(WKFramePolicyListenerRef _listener, Ewk_Navigation_Type _navigationType, Event_Mouse_Button _mouseButton, Event_Modifier_Keys _modifiers, Ewk_Url_Request* _request, const char* _frameName) - : listener(_listener) + : __ref(1) + , listener(_listener) , actedUponByClient(false) , navigationType(_navigationType) , mouseButton(_mouseButton) @@ -57,18 +59,34 @@ struct _Ewk_Navigation_Policy_Decision { , request(_request) , frameName(eina_stringshare_add(_frameName)) { } + + ~_Ewk_Navigation_Policy_Decision() + { + ASSERT(!__ref); + + // This is the default choice for all policy decisions in WebPageProxy.cpp. + if (!actedUponByClient) + WKFramePolicyListenerUse(listener.get()); + + ewk_url_request_unref(request); + eina_stringshare_del(frameName); + } }; -void ewk_navigation_policy_decision_free(Ewk_Navigation_Policy_Decision* decision) +void ewk_navigation_policy_decision_ref(Ewk_Navigation_Policy_Decision* decision) +{ + EINA_SAFETY_ON_NULL_RETURN(decision); + + ++decision->__ref; +} + +void ewk_navigation_policy_decision_unref(Ewk_Navigation_Policy_Decision* decision) { EINA_SAFETY_ON_NULL_RETURN(decision); - // This is the default choice for all policy decisions in WebPageProxy.cpp. - if (!decision->actedUponByClient) - WKFramePolicyListenerUse(decision->listener.get()); + if (--decision->__ref) + return; - ewk_url_request_unref(decision->request); - eina_stringshare_del(decision->frameName); delete decision; } diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision.h b/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision.h index 7681a9f20..dec9c09f9 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision.h @@ -67,11 +67,20 @@ typedef enum { } Event_Modifier_Keys; /** - * Frees the given object. + * Increases the reference count of the given object. * - * @param decision the policy decision object to free + * @param decision the policy decision object to increase the reference count */ -EAPI void ewk_navigation_policy_decision_free(Ewk_Navigation_Policy_Decision *decision); +EAPI void ewk_navigation_policy_decision_ref(Ewk_Navigation_Policy_Decision *decision); + +/** + * Decreases the reference count of the given object, possibly freeing it. + * + * When the reference count reaches 0, the object is freed. + * + * @param decision the policy decision object to decrease the reference count + */ +EAPI void ewk_navigation_policy_decision_unref(Ewk_Navigation_Policy_Decision *decision); /** * Query type for this navigation policy decision. diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_url_request.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_url_request.cpp index f29a40e5d..a424ddda3 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_url_request.cpp +++ b/Source/WebKit2/UIProcess/API/efl/ewk_url_request.cpp @@ -56,6 +56,14 @@ struct _Ewk_Url_Request { , first_party(0) , http_method(0) { } + + ~_Ewk_Url_Request() + { + ASSERT(!__ref); + eina_stringshare_del(url); + eina_stringshare_del(first_party); + eina_stringshare_del(http_method); + } }; #define EWK_URL_REQUEST_WK_GET_OR_RETURN(request, wkRequest_, ...) \ @@ -82,9 +90,6 @@ void ewk_url_request_unref(Ewk_Url_Request* request) if (--request->__ref) return; - eina_stringshare_del(request->url); - eina_stringshare_del(request->first_party); - eina_stringshare_del(request->http_method); delete request; } diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_url_request.h b/Source/WebKit2/UIProcess/API/efl/ewk_url_request.h index 0150b8917..ec44f5c1e 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_url_request.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_url_request.h @@ -50,7 +50,7 @@ EAPI void ewk_url_request_ref(Ewk_Url_Request *request); /** * Decreases the reference count of the given object, possibly freeing it. * - * When the reference count it's reached 0, the URL request is freed. + * When the reference count reaches 0, the URL request is freed. * * @param request the URL request object to decrease the reference count */ diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_url_response.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_url_response.cpp index 2ab129717..137753d60 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_url_response.cpp +++ b/Source/WebKit2/UIProcess/API/efl/ewk_url_response.cpp @@ -46,6 +46,13 @@ struct _Ewk_Url_Response { , url(0) , mimeType(0) { } + + ~_Ewk_Url_Response() + { + ASSERT(!__ref); + eina_stringshare_del(url); + eina_stringshare_del(mimeType); + } }; void ewk_url_response_ref(Ewk_Url_Response* response) @@ -61,8 +68,6 @@ void ewk_url_response_unref(Ewk_Url_Response* response) if (--response->__ref) return; - eina_stringshare_del(response->url); - eina_stringshare_del(response->mimeType); delete response; } diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_url_response.h b/Source/WebKit2/UIProcess/API/efl/ewk_url_response.h index 165e9a61c..c02622dd7 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_url_response.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_url_response.h @@ -50,7 +50,7 @@ EAPI void ewk_url_response_ref(Ewk_Url_Response *response); /** * Decreases the reference count of the given object, possibly freeing it. * - * When the reference count it's reached 0, the URL request is freed. + * When the reference count reaches 0, the URL response is freed. * * @param response the URL response object to decrease the reference count */ diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp index eb1e5e7b2..8b7132b48 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp +++ b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp @@ -49,12 +49,21 @@ struct _Ewk_View_Private_Data { OwnPtr<PageClientImpl> pageClient; const char* uri; const char* title; + const char* theme; LoadingResourcesMap loadingResourcesMap; _Ewk_View_Private_Data() : uri(0) , title(0) + , theme(0) { } + + ~_Ewk_View_Private_Data() + { + eina_stringshare_del(uri); + eina_stringshare_del(title); + eina_stringshare_del(theme); + } }; #define EWK_VIEW_TYPE_CHECK(ewkView, result) \ @@ -276,12 +285,6 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* smartData) static void _ewk_view_priv_del(Ewk_View_Private_Data* priv) { - if (!priv) - return; - - priv->pageClient = nullptr; - eina_stringshare_del(priv->uri); - eina_stringshare_del(priv->title); delete priv; } @@ -507,6 +510,8 @@ Evas_Object* ewk_view_base_add(Evas* canvas, WKContextRef contextRef, WKPageGrou ewk_view_policy_client_attach(toAPI(priv->pageClient->page()), ewkView); ewk_view_resource_load_client_attach(toAPI(priv->pageClient->page()), ewkView); + ewk_view_theme_set(ewkView, DEFAULT_THEME_PATH"/default.edj"); + return ewkView; } @@ -738,6 +743,24 @@ void ewk_view_intent_request_new(Evas_Object* ewkView, const Ewk_Intent* ewkInte #endif } +void ewk_view_theme_set(Evas_Object* ewkView, const char* path) +{ + EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData); + EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv); + + if (!eina_stringshare_replace(&priv->theme, path)) + return; + + priv->pageClient->page()->setThemePath(path); +} + +const char* ewk_view_theme_get(const Evas_Object* ewkView) +{ + EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0); + EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, 0); + return priv->theme; +} + void ewk_view_display(Evas_Object* ewkView, const IntRect& rect) { EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData); diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view.h b/Source/WebKit2/UIProcess/API/efl/ewk_view.h index 58552ec7d..fe3f10675 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_view.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_view.h @@ -35,7 +35,11 @@ * - "load,provisional,redirect", void: view received redirect for provisional load. * - "load,provisional,started", void: view started provisional load. * - "policy,decision,navigation", Ewk_Navigation_Policy_Decision*: a navigation policy decision should be taken. + * To make a policy decision asynchronously, simply increment the reference count of the + * #Ewk_Navigation_Policy_Decision object using ewk_navigation_policy_decision_ref(). * - "policy,decision,new,window", Ewk_Navigation_Policy_Decision*: a new window policy decision should be taken. + * To make a policy decision asynchronously, simply increment the reference count of the + * #Ewk_Navigation_Policy_Decision object using ewk_navigation_policy_decision_ref(). * - "resource,request,failed", const Ewk_Web_Resource_Load_Error*: a resource failed loading. * - "resource,request,finished", const Ewk_Web_Resource*: a resource finished loading. * - "resource,request,new", const Ewk_Web_Resource_Request*: a resource request was initiated. @@ -189,7 +193,7 @@ struct _Ewk_Web_Resource_Load_Error { * * @param e canvas object where to create the view object * - * @return view object on success or @c 0 on failure + * @return view object on success or @c NULL on failure */ EAPI Evas_Object *ewk_view_add(Evas *e); @@ -199,7 +203,7 @@ EAPI Evas_Object *ewk_view_add(Evas *e); * @param e canvas object where to create the view object * @param context Ewk_Context object to declare process model * - * @return view object on success or @c 0 on failure + * @return view object on success or @c NULL on failure */ EAPI Evas_Object *ewk_view_add_with_context(Evas *e, Ewk_Context *context); @@ -221,7 +225,7 @@ EAPI Eina_Bool ewk_view_uri_set(Evas_Object *o, const char *uri); * * @param o view object to get current URI * - * @return current URI on success or @c 0 on failure + * @return current URI on success or @c NULL on failure */ EAPI const char *ewk_view_uri_get(const Evas_Object *o); @@ -311,7 +315,7 @@ EAPI Eina_Bool ewk_view_forward_possible(Evas_Object *o); * * @param o view object to get current title * - * @return current title on success or @c 0 on failure + * @return current title on success or @c NULL on failure */ EAPI const char *ewk_view_title_get(const Evas_Object *o); @@ -393,6 +397,29 @@ EAPI float ewk_view_device_pixel_ratio_get(const Evas_Object *o); */ EAPI Eina_Bool ewk_view_device_pixel_ratio_set(Evas_Object *o, float ratio); +/** + * Sets the theme path that will be used by this view. + * + * This also sets the theme on the main frame. As frames inherit theme + * from their parent, this will have all frames with unset theme to + * use this one. + * + * @param o view object to change theme + * @param path theme path, may be @c NULL to reset to the default theme + */ +EAPI void ewk_view_theme_set(Evas_Object *o, const char *path); + +/** + * Gets the theme set on this view. + * + * This returns the value set by ewk_view_theme_set(). + * + * @param o view object to get theme path + * + * @return the theme path, may be @c NULL if not set + */ +EAPI const char *ewk_view_theme_get(const Evas_Object *o); + #ifdef __cplusplus } #endif diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view_policy_client.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_view_policy_client.cpp index 5f689e56d..6e2540f80 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_view_policy_client.cpp +++ b/Source/WebKit2/UIProcess/API/efl/ewk_view_policy_client.cpp @@ -26,12 +26,14 @@ #include "config.h" #include "WKFrame.h" +#include "WKFramePolicyListener.h" #include "ewk_navigation_policy_decision.h" #include "ewk_navigation_policy_decision_private.h" #include "ewk_view_policy_client_private.h" #include "ewk_view_private.h" #include <wtf/text/CString.h> +using namespace WebCore; using namespace WebKit; static inline Evas_Object* toEwkView(const void* clientInfo) @@ -43,14 +45,47 @@ static void decidePolicyForNavigationAction(WKPageRef page, WKFrameRef frame, WK { Ewk_Navigation_Policy_Decision* decision = ewk_navigation_policy_decision_new(navigationType, mouseButton, modifiers, request, 0, listener); ewk_view_navigation_policy_decision(toEwkView(clientInfo), decision); - ewk_navigation_policy_decision_free(decision); + ewk_navigation_policy_decision_unref(decision); } static void decidePolicyForNewWindowAction(WKPageRef page, WKFrameRef frame, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKURLRequestRef request, WKStringRef frameName, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo) { Ewk_Navigation_Policy_Decision* decision = ewk_navigation_policy_decision_new(navigationType, mouseButton, modifiers, request, toImpl(frameName)->string().utf8().data(), listener); ewk_view_new_window_policy_decision(toEwkView(clientInfo), decision); - ewk_navigation_policy_decision_free(decision); + ewk_navigation_policy_decision_unref(decision); +} + +static void decidePolicyForResponseCallback(WKPageRef page, WKFrameRef frame, WKURLResponseRef response, WKURLRequestRef, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo) +{ + const ResourceResponse resourceResponse = toImpl(response)->resourceResponse(); + // If the URL Response has "Content-Disposition: attachment;" header, then + // we should download it. + if (resourceResponse.isAttachment()) { + WKFramePolicyListenerDownload(listener); + return; + } + + String mimeType = toImpl(response)->resourceResponse().mimeType().lower(); + bool canShowMIMEType = toImpl(frame)->canShowMIMEType(mimeType); + if (WKFrameIsMainFrame(frame)) { + if (canShowMIMEType) { + WKFramePolicyListenerUse(listener); + return; + } + + // If we can't use (show) it then we should download it. + WKFramePolicyListenerDownload(listener); + return; + } + + // We should ignore downloadable top-level content for subframes, with an exception for text/xml and application/xml so we can still support Acid3 test. + // It makes the browser intentionally behave differently when it comes to text(application)/xml content in subframes vs. mainframe. + if (!canShowMIMEType && !(mimeType == "text/xml" || mimeType == "application/xml")) { + WKFramePolicyListenerIgnore(listener); + return; + } + + WKFramePolicyListenerUse(listener); } void ewk_view_policy_client_attach(WKPageRef pageRef, Evas_Object* ewkView) @@ -61,6 +96,7 @@ void ewk_view_policy_client_attach(WKPageRef pageRef, Evas_Object* ewkView) policyClient.clientInfo = ewkView; policyClient.decidePolicyForNavigationAction = decidePolicyForNavigationAction; policyClient.decidePolicyForNewWindowAction = decidePolicyForNewWindowAction; + policyClient.decidePolicyForResponse = decidePolicyForResponseCallback; WKPageSetPagePolicyClient(pageRef, &policyClient); } diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_web_error.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_web_error.cpp index 0ac75ab68..f16fb2cc3 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_web_error.cpp +++ b/Source/WebKit2/UIProcess/API/efl/ewk_web_error.cpp @@ -50,6 +50,12 @@ struct _Ewk_Web_Error { , url(0) , description(0) { } + + ~_Ewk_Web_Error() + { + eina_stringshare_del(url); + eina_stringshare_del(description); + } }; #define EWK_WEB_ERROR_WK_GET_OR_RETURN(error, wkError_, ...) \ @@ -63,12 +69,10 @@ struct _Ewk_Web_Error { } \ WKErrorRef wkError_ = (error)->wkError.get() -void ewk_web_error_free(Ewk_Web_Error *error) +void ewk_web_error_free(Ewk_Web_Error* error) { EINA_SAFETY_ON_NULL_RETURN(error); - eina_stringshare_del(error->url); - eina_stringshare_del(error->description); delete error; } diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_web_resource.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_web_resource.cpp index 44d9c2afc..e0d728a9e 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_web_resource.cpp +++ b/Source/WebKit2/UIProcess/API/efl/ewk_web_resource.cpp @@ -39,6 +39,12 @@ struct _Ewk_Web_Resource { , url(eina_stringshare_add(_url)) , isMainResource(_isMainResource) { } + + ~_Ewk_Web_Resource() + { + ASSERT(!__ref); + eina_stringshare_del(url); + } }; void ewk_web_resource_ref(Ewk_Web_Resource* resource) @@ -55,7 +61,6 @@ void ewk_web_resource_unref(Ewk_Web_Resource* resource) if (--resource->__ref) return; - eina_stringshare_del(resource->url); delete resource; } diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_web_resource.h b/Source/WebKit2/UIProcess/API/efl/ewk_web_resource.h index 3d78d4bc9..47fd7adf4 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_web_resource.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_web_resource.h @@ -50,7 +50,7 @@ EAPI void ewk_web_resource_ref(Ewk_Web_Resource *resource); /** * Decreases the reference count of the given object, possibly freeing it. * - * When the reference count it's reached 0, the resource is freed. + * When the reference count reaches 0, the resource is freed. * * @param resource the resource object to decrease the reference count */ diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp index b7ffc98b8..f65fa97ed 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp @@ -188,7 +188,7 @@ static void webkitWebViewBaseContainerAdd(GtkContainer* container, GtkWidget* wi if (WEBKIT_IS_WEB_VIEW_BASE(widget) && WebInspectorProxy::isInspectorPage(WEBKIT_WEB_VIEW_BASE(widget)->priv->pageProxy.get())) { - ASSERT(priv->inspectorView); + ASSERT(!priv->inspectorView); priv->inspectorView = widget; priv->inspectorViewHeight = gMinimumAttachedInspectorHeight; } else { diff --git a/Source/WebKit2/UIProcess/API/gtk/tests/GNUmakefile.am b/Source/WebKit2/UIProcess/API/gtk/tests/GNUmakefile.am index 919202522..3fadf40b4 100644 --- a/Source/WebKit2/UIProcess/API/gtk/tests/GNUmakefile.am +++ b/Source/WebKit2/UIProcess/API/gtk/tests/GNUmakefile.am @@ -67,6 +67,10 @@ Libraries_libWebKit2APITestCore_la_SOURCES = \ Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.h Libraries_libWebKit2APITestCore_la_CPPFLAGS = $(webkit2_tests_cppflags) +EXTRA_DIST += \ + Source/WebKit2/UIProcess/API/gtk/tests/resources/test-cert.pem \ + Source/WebKit2/UIProcess/API/gtk/tests/resources/test-key.pem + Programs_WebKit2APITests_TestWebKitWebContext_SOURCES = \ Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebContext.cpp Programs_WebKit2APITests_TestWebKitWebContext_CPPFLAGS = \ diff --git a/Source/WebKit2/UIProcess/API/gtk/tests/TestResources.cpp b/Source/WebKit2/UIProcess/API/gtk/tests/TestResources.cpp index 7de95e0f0..43f59e1e7 100644 --- a/Source/WebKit2/UIProcess/API/gtk/tests/TestResources.cpp +++ b/Source/WebKit2/UIProcess/API/gtk/tests/TestResources.cpp @@ -293,16 +293,16 @@ public: m_loadEvents.append(Failed); } - void waitUntilResourceLoadFinsihed() + void waitUntilResourceLoadFinished() { m_resource = 0; m_resourcesLoaded = 0; g_main_loop_run(m_mainLoop); } - WebKitURIResponse* waitUntilResourceLoadFinsihedAndReturnURIResponse() + WebKitURIResponse* waitUntilResourceLoadFinishedAndReturnURIResponse() { - waitUntilResourceLoadFinsihed(); + waitUntilResourceLoadFinished(); g_assert(m_resource); return webkit_web_resource_get_response(m_resource.get()); } @@ -315,7 +315,7 @@ public: static void testWebResourceLoading(SingleResourceLoadTest* test, gconstpointer) { test->loadURI(kServer->getURIForPath("/javascript.html").data()); - test->waitUntilResourceLoadFinsihed(); + test->waitUntilResourceLoadFinished(); g_assert(test->m_resource); Vector<SingleResourceLoadTest::LoadEvents>& events = test->m_loadEvents; g_assert_cmpint(events.size(), ==, 5); @@ -327,7 +327,7 @@ static void testWebResourceLoading(SingleResourceLoadTest* test, gconstpointer) events.clear(); test->loadURI(kServer->getURIForPath("/redirected-css.html").data()); - test->waitUntilResourceLoadFinsihed(); + test->waitUntilResourceLoadFinished(); g_assert(test->m_resource); g_assert_cmpint(events.size(), ==, 6); g_assert_cmpint(events[0], ==, SingleResourceLoadTest::Started); @@ -339,7 +339,7 @@ static void testWebResourceLoading(SingleResourceLoadTest* test, gconstpointer) events.clear(); test->loadURI(kServer->getURIForPath("/invalid-css.html").data()); - test->waitUntilResourceLoadFinsihed(); + test->waitUntilResourceLoadFinished(); g_assert(test->m_resource); g_assert_cmpint(events.size(), ==, 4); g_assert_cmpint(events[0], ==, SingleResourceLoadTest::Started); @@ -353,47 +353,47 @@ static void testWebResourceResponse(SingleResourceLoadTest* test, gconstpointer) { // No cached resource: First load. test->loadURI(kServer->getURIForPath("/javascript.html").data()); - WebKitURIResponse* response = test->waitUntilResourceLoadFinsihedAndReturnURIResponse(); + WebKitURIResponse* response = test->waitUntilResourceLoadFinishedAndReturnURIResponse(); g_assert_cmpint(webkit_uri_response_get_status_code(response), ==, SOUP_STATUS_OK); // No cached resource: Second load. test->loadURI(kServer->getURIForPath("/javascript.html").data()); - response = test->waitUntilResourceLoadFinsihedAndReturnURIResponse(); + response = test->waitUntilResourceLoadFinishedAndReturnURIResponse(); g_assert_cmpint(webkit_uri_response_get_status_code(response), ==, SOUP_STATUS_OK); // No cached resource: Reload. webkit_web_view_reload(test->m_webView); - response = test->waitUntilResourceLoadFinsihedAndReturnURIResponse(); + response = test->waitUntilResourceLoadFinishedAndReturnURIResponse(); g_assert_cmpint(webkit_uri_response_get_status_code(response), ==, SOUP_STATUS_OK); // Cached resource: First load. test->loadURI(kServer->getURIForPath("/image.html").data()); - response = test->waitUntilResourceLoadFinsihedAndReturnURIResponse(); + response = test->waitUntilResourceLoadFinishedAndReturnURIResponse(); g_assert_cmpint(webkit_uri_response_get_status_code(response), ==, SOUP_STATUS_OK); // Cached resource: Second load. test->loadURI(kServer->getURIForPath("/image.html").data()); - response = test->waitUntilResourceLoadFinsihedAndReturnURIResponse(); + response = test->waitUntilResourceLoadFinishedAndReturnURIResponse(); g_assert_cmpint(webkit_uri_response_get_status_code(response), ==, SOUP_STATUS_OK); // Cached resource: Reload. webkit_web_view_reload(test->m_webView); - response = test->waitUntilResourceLoadFinsihedAndReturnURIResponse(); + response = test->waitUntilResourceLoadFinishedAndReturnURIResponse(); g_assert_cmpint(webkit_uri_response_get_status_code(response), ==, SOUP_STATUS_NOT_MODIFIED); } static void testWebResourceMimeType(SingleResourceLoadTest* test, gconstpointer) { test->loadURI(kServer->getURIForPath("/javascript.html").data()); - WebKitURIResponse* response = test->waitUntilResourceLoadFinsihedAndReturnURIResponse(); + WebKitURIResponse* response = test->waitUntilResourceLoadFinishedAndReturnURIResponse(); g_assert_cmpstr(webkit_uri_response_get_mime_type(response), ==, "text/javascript"); test->loadURI(kServer->getURIForPath("/image.html").data()); - response = test->waitUntilResourceLoadFinsihedAndReturnURIResponse(); + response = test->waitUntilResourceLoadFinishedAndReturnURIResponse(); g_assert_cmpstr(webkit_uri_response_get_mime_type(response), ==, "image/vnd.microsoft.icon"); test->loadURI(kServer->getURIForPath("/redirected-css.html").data()); - response = test->waitUntilResourceLoadFinsihedAndReturnURIResponse(); + response = test->waitUntilResourceLoadFinishedAndReturnURIResponse(); g_assert_cmpstr(webkit_uri_response_get_mime_type(response), ==, "text/css"); } @@ -475,7 +475,7 @@ private: static void testWebResourceActiveURI(ResourceURITrackingTest* test, gconstpointer) { test->loadURI(kServer->getURIForPath("/redirected-css.html").data()); - test->waitUntilResourceLoadFinsihed(); + test->waitUntilResourceLoadFinished(); } static void testWebResourceGetData(ResourcesTest* test, gconstpointer) @@ -543,7 +543,7 @@ static void serverCallback(SoupServer* server, SoupMessage* message, const char* soup_message_set_status(message, SOUP_STATUS_OK); - if (soup_message_headers_get(message->request_headers, "If-Modified-Since")) { + if (soup_message_headers_get_one(message->request_headers, "If-Modified-Since")) { soup_message_set_status(message, SOUP_STATUS_NOT_MODIFIED); soup_message_body_complete(message->response_body); return; diff --git a/Source/WebKit2/UIProcess/LayerTreeCoordinatorProxy.cpp b/Source/WebKit2/UIProcess/LayerTreeCoordinatorProxy.cpp index dad90934c..629291a4b 100644 --- a/Source/WebKit2/UIProcess/LayerTreeCoordinatorProxy.cpp +++ b/Source/WebKit2/UIProcess/LayerTreeCoordinatorProxy.cpp @@ -61,26 +61,20 @@ void LayerTreeCoordinatorProxy::createTileForLayer(int layerID, int tileID, cons updateTileForLayer(layerID, tileID, targetRect, updateInfo); } -static inline uint64_t createLayerTileUniqueKey(int layerID, int tileID) -{ - uint64_t key = layerID; - key <<= 32; - key |= tileID; - return key; -} - void LayerTreeCoordinatorProxy::updateTileForLayer(int layerID, int tileID, const IntRect& targetRect, const WebKit::SurfaceUpdateInfo& updateInfo) { RefPtr<ShareableSurface> surface; #if USE(GRAPHICS_SURFACE) - uint64_t key = createLayerTileUniqueKey(layerID, tileID); - - HashMap<uint64_t, RefPtr<ShareableSurface> >::iterator it = m_surfaces.find(key); - if (it == m_surfaces.end()) { - surface = ShareableSurface::create(updateInfo.surfaceHandle); - m_surfaces.add(key, surface); + int token = updateInfo.surfaceHandle.graphicsSurfaceToken(); + if (token) { + HashMap<uint32_t, RefPtr<ShareableSurface> >::iterator it = m_surfaces.find(token); + if (it == m_surfaces.end()) { + surface = ShareableSurface::create(updateInfo.surfaceHandle); + m_surfaces.add(token, surface); + } else + surface = it->second; } else - surface = it->second; + surface = ShareableSurface::create(updateInfo.surfaceHandle); #else surface = ShareableSurface::create(updateInfo.surfaceHandle); #endif diff --git a/Source/WebKit2/UIProcess/LayerTreeCoordinatorProxy.h b/Source/WebKit2/UIProcess/LayerTreeCoordinatorProxy.h index c0edb6658..b4e7b7ce2 100644 --- a/Source/WebKit2/UIProcess/LayerTreeCoordinatorProxy.h +++ b/Source/WebKit2/UIProcess/LayerTreeCoordinatorProxy.h @@ -79,7 +79,7 @@ protected: DrawingAreaProxy* m_drawingAreaProxy; RefPtr<WebLayerTreeRenderer> m_renderer; #if USE(GRAPHICS_SURFACE) - HashMap<uint64_t, RefPtr<ShareableSurface> > m_surfaces; + HashMap<uint32_t, RefPtr<ShareableSurface> > m_surfaces; #endif }; diff --git a/Source/WebKit2/UIProcess/WebPageProxy.h b/Source/WebKit2/UIProcess/WebPageProxy.h index 6c7e68811..29a6c65c5 100644 --- a/Source/WebKit2/UIProcess/WebPageProxy.h +++ b/Source/WebKit2/UIProcess/WebPageProxy.h @@ -362,6 +362,9 @@ public: void proxyAuthenticationRequiredRequest(const String& hostname, uint16_t port, const String& prefilledUsername, String& username, String& password); void setUserScripts(const Vector<String>&); #endif // PLATFORM(QT). +#if PLATFORM(EFL) + void setThemePath(const String&); +#endif #if PLATFORM(QT) void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd); diff --git a/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp b/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp index b076b4ef6..e1eda1035 100644 --- a/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp +++ b/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp @@ -28,6 +28,8 @@ #include "NotImplemented.h" #include "PageClientImpl.h" +#include "WebPageMessages.h" +#include "WebProcessProxy.h" #include <sys/utsname.h> @@ -76,4 +78,9 @@ void WebPageProxy::loadRecentSearches(const String&, Vector<String>&) notImplemented(); } +void WebPageProxy::setThemePath(const String& themePath) +{ + process()->send(Messages::WebPage::SetThemePath(themePath), m_pageID, 0); +} + } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/qt/QtWebIconDatabaseClient.cpp b/Source/WebKit2/UIProcess/qt/QtWebIconDatabaseClient.cpp index 592bb371c..afdfa6fcd 100644 --- a/Source/WebKit2/UIProcess/qt/QtWebIconDatabaseClient.cpp +++ b/Source/WebKit2/UIProcess/qt/QtWebIconDatabaseClient.cpp @@ -90,11 +90,11 @@ QImage QtWebIconDatabaseClient::iconImageForPageURL(const WTF::String& pageURL, WebCore::IntSize size(iconSize.width(), iconSize.height()); - QPixmap* nativeImage = m_iconDatabase->nativeImageForPageURL(pageURL, size); + QImage* nativeImage = m_iconDatabase->nativeImageForPageURL(pageURL, size); if (!nativeImage) return QImage(); - return nativeImage->toImage(); + return *nativeImage; } void QtWebIconDatabaseClient::retainIconForPageURL(const String& pageURL) diff --git a/Source/WebKit2/UIProcess/texmap/LayerBackingStore.cpp b/Source/WebKit2/UIProcess/texmap/LayerBackingStore.cpp index 967f07513..43dbe0cba 100644 --- a/Source/WebKit2/UIProcess/texmap/LayerBackingStore.cpp +++ b/Source/WebKit2/UIProcess/texmap/LayerBackingStore.cpp @@ -141,7 +141,8 @@ void LayerBackingStore::paintToTextureMapper(TextureMapper* textureMapper, const static bool shouldDebug = shouldShowTileDebugVisuals(); if (!shouldDebug) continue; - textureMapper->drawBorder(QColor(Qt::red), 2, tile->rect(), transform); + + textureMapper->drawBorder(Color(0xFF, 0, 0), 2, tile->rect(), transform); textureMapper->drawRepaintCounter(static_cast<LayerBackingStoreTile*>(tile)->repaintCount(), 8, tilesToPaint[i]->rect().location(), transform); } } diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebBatteryClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebBatteryClient.cpp index 8ed4dde03..91033fa64 100644 --- a/Source/WebKit2/WebProcess/WebCoreSupport/WebBatteryClient.cpp +++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebBatteryClient.cpp @@ -36,14 +36,6 @@ using namespace WebCore; namespace WebKit { -void WebBatteryClient::setController(WebCore::BatteryController*) -{ - // We provide an empty implementation for this method so that - // it compiles. We don't need it since WebBatteryManager - // retrieves the controller directly from the page by calling - // BatteryController::from(). -} - void WebBatteryClient::startUpdating() { WebProcess::shared().batteryManager().registerWebPage(m_page); diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebBatteryClient.h b/Source/WebKit2/WebProcess/WebCoreSupport/WebBatteryClient.h index 0e5c70ed4..b260c624c 100644 --- a/Source/WebKit2/WebProcess/WebCoreSupport/WebBatteryClient.h +++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebBatteryClient.h @@ -44,7 +44,6 @@ public: virtual ~WebBatteryClient() { } private: - virtual void setController(WebCore::BatteryController*) OVERRIDE; virtual void startUpdating() OVERRIDE; virtual void stopUpdating() OVERRIDE; virtual void batteryControllerDestroyed() OVERRIDE; diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h index e3b3a5e84..aa5457799 100644 --- a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h +++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h @@ -220,15 +220,6 @@ private: virtual void numWheelEventHandlersChanged(unsigned) OVERRIDE; virtual void numTouchEventHandlersChanged(unsigned) OVERRIDE { } -#if ENABLE(REGISTER_PROTOCOL_HANDLER) - virtual void registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title) OVERRIDE { } -#endif - -#if ENABLE(CUSTOM_SCHEME_HANDLER) - virtual CustomHandlersState isProtocolHandlerRegistered(const String&, const String&, const String&) { return CustomHandlersDeclined; } - virtual void unregisterProtocolHandler(const String&, const String&, const String&) { } -#endif - String m_cachedToolTip; mutable RefPtr<WebFrame> m_cachedFrameSetLargestFrame; mutable bool m_cachedMainFrameHasHorizontalScrollbar; diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp index 14511856b..2c30b72bd 100644 --- a/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp +++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp @@ -43,10 +43,11 @@ void WebInspectorClient::inspectorDestroyed() delete this; } -void WebInspectorClient::openInspectorFrontend(InspectorController*) +WebCore::InspectorFrontendChannel* WebInspectorClient::openInspectorFrontend(InspectorController*) { WebPage* inspectorPage = m_page->inspector()->createInspectorPage(); ASSERT_UNUSED(inspectorPage, inspectorPage); + return this; } void WebInspectorClient::closeInspectorFrontend() diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.h b/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.h index 7926d5a80..850041af1 100644 --- a/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.h +++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.h @@ -31,6 +31,7 @@ #include "PageOverlay.h" #include <WebCore/InspectorClient.h> +#include <WebCore/InspectorFrontendChannel.h> namespace WebCore { class GraphicsContext; @@ -41,7 +42,7 @@ namespace WebKit { class WebPage; -class WebInspectorClient : public WebCore::InspectorClient, private PageOverlay::Client { +class WebInspectorClient : public WebCore::InspectorClient, public WebCore::InspectorFrontendChannel, private PageOverlay::Client { public: WebInspectorClient(WebPage* page) : m_page(page) @@ -52,7 +53,7 @@ public: private: virtual void inspectorDestroyed() OVERRIDE; - virtual void openInspectorFrontend(WebCore::InspectorController*) OVERRIDE; + virtual InspectorFrontendChannel* openInspectorFrontend(WebCore::InspectorController*) OVERRIDE; virtual void closeInspectorFrontend() OVERRIDE; virtual void bringFrontendToFront() OVERRIDE; virtual void didResizeMainFrame(WebCore::Frame*) OVERRIDE; diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebRegisterProtocolHandlerClient.h b/Source/WebKit2/WebProcess/WebCoreSupport/WebRegisterProtocolHandlerClient.h new file mode 100644 index 000000000..7019747b9 --- /dev/null +++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebRegisterProtocolHandlerClient.h @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2012 Samsung Electronics. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebRegisterProtocolHandlerClient_h +#define WebRegisterProtocolHandlerClient_h + +#include <WebCore/RegisterProtocolHandlerClient.h> +#include <wtf/text/WTFString.h> + +namespace WebKit { + +class WebRegisterProtocolHandlerClient : public WebCore::RegisterProtocolHandlerClient { +public: + virtual ~WebRegisterProtocolHandlerClient() { } + +private: +#if ENABLE(REGISTER_PROTOCOL_HANDLER) + virtual void registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title) OVERRIDE { } +#endif + +#if ENABLE(CUSTOM_SCHEME_HANDLER) + virtual CustomHandlersState isProtocolHandlerRegistered(const String&, const String&, const String&) { return CustomHandlersDeclined; } + virtual void unregisterProtocolHandler(const String&, const String&, const String&) { } +#endif +}; + +} + +#endif // WebRegisterProtocolHandlerClient_h diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/qt/WebDragClientQt.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/qt/WebDragClientQt.cpp index bbdb635b3..d9e6d1d13 100644 --- a/Source/WebKit2/WebProcess/WebCoreSupport/qt/WebDragClientQt.cpp +++ b/Source/WebKit2/WebProcess/WebCoreSupport/qt/WebDragClientQt.cpp @@ -38,15 +38,15 @@ using namespace WebCore; namespace WebKit { -static PassRefPtr<ShareableBitmap> convertQPixmapToShareableBitmap(QPixmap* pixmap) +static PassRefPtr<ShareableBitmap> convertQImageToShareableBitmap(QImage* image) { - if (!pixmap) + if (!image) return 0; - RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(IntSize(pixmap->size()), ShareableBitmap::SupportsAlpha); + RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(IntSize(image->size()), ShareableBitmap::SupportsAlpha); OwnPtr<GraphicsContext> graphicsContext = bitmap->createGraphicsContext(); - graphicsContext->platformContext()->drawPixmap(0, 0, *pixmap); + graphicsContext->platformContext()->drawImage(0, 0, *image); return bitmap.release(); } @@ -57,7 +57,7 @@ void WebDragClient::startDrag(DragImageRef dragImage, const IntPoint& clientPosi static_cast<ClipboardQt*>(clipboard)->invalidateWritableData(); DragData dragData(clipboardData, clientPosition, globalPosition, dragOperationMask); - RefPtr<ShareableBitmap> bitmap = convertQPixmapToShareableBitmap(dragImage); + RefPtr<ShareableBitmap> bitmap = convertQImageToShareableBitmap(dragImage); ShareableBitmap::Handle handle; if (bitmap && !bitmap->createHandle(handle)) return; diff --git a/Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.cpp b/Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.cpp index ae099d15c..a3b9a1391 100644 --- a/Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.cpp +++ b/Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.cpp @@ -409,12 +409,12 @@ int64_t LayerTreeCoordinator::adoptImageBackingStore(Image* image) int64_t key = 0; #if PLATFORM(QT) - QPixmap* pixmap = image->nativeImageForCurrentFrame(); + QImage* nativeImage = image->nativeImageForCurrentFrame(); - if (!pixmap) + if (!nativeImage) return InvalidWebLayerID; - key = pixmap->cacheKey(); + key = nativeImage->cacheKey(); #endif HashMap<int64_t, int>::iterator it = m_directlyCompositedImageRefCounts.find(key); diff --git a/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp b/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp index 68d3b0c41..7fa40e14f 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp +++ b/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp @@ -27,7 +27,6 @@ #include "WebInspector.h" #if ENABLE(INSPECTOR) - #include "WebFrame.h" #include "WebInspectorFrontendClient.h" #include "WebInspectorProxyMessages.h" @@ -35,21 +34,23 @@ #include "WebPageCreationParameters.h" #include "WebProcess.h" #include <WebCore/InspectorController.h> +#include <WebCore/InspectorFrontendChannel.h> #include <WebCore/Page.h> using namespace WebCore; namespace WebKit { -PassRefPtr<WebInspector> WebInspector::create(WebPage* page) +PassRefPtr<WebInspector> WebInspector::create(WebPage* page, InspectorFrontendChannel* frontendChannel) { - return adoptRef(new WebInspector(page)); + return adoptRef(new WebInspector(page, frontendChannel)); } -WebInspector::WebInspector(WebPage* page) +WebInspector::WebInspector(WebPage* page, InspectorFrontendChannel* frontendChannel) : m_page(page) , m_inspectorPage(0) , m_frontendClient(0) + , m_frontendChannel(frontendChannel) #if ENABLE(INSPECTOR_SERVER) , m_remoteFrontendConnected(false) #endif @@ -91,6 +92,7 @@ void WebInspector::destroyInspectorPage() { m_inspectorPage = 0; m_frontendClient = 0; + m_frontendChannel = 0; } // Called from WebInspectorFrontendClient @@ -255,8 +257,8 @@ void WebInspector::remoteFrontendConnected() ASSERT(!m_remoteFrontendConnected); // Switching between in-process and remote inspectors isn't supported yet. ASSERT(!m_inspectorPage); - - m_page->corePage()->inspectorController()->connectFrontend(); + + m_page->corePage()->inspectorController()->connectFrontend(m_frontendChannel); m_remoteFrontendConnected = true; } diff --git a/Source/WebKit2/WebProcess/WebPage/WebInspector.h b/Source/WebKit2/WebProcess/WebPage/WebInspector.h index 575725ae6..c041546a8 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebInspector.h +++ b/Source/WebKit2/WebProcess/WebPage/WebInspector.h @@ -33,6 +33,10 @@ #include <wtf/Noncopyable.h> #include <wtf/text/WTFString.h> +namespace WebCore { +class InspectorFrontendChannel; +} + namespace WebKit { class WebInspectorFrontendClient; @@ -43,7 +47,7 @@ class WebInspector : public APIObject { public: static const Type APIType = TypeBundleInspector; - static PassRefPtr<WebInspector> create(WebPage*); + static PassRefPtr<WebInspector> create(WebPage*, WebCore::InspectorFrontendChannel*); WebPage* page() const { return m_page; } WebPage* inspectorPage() const { return m_inspectorPage; } @@ -77,7 +81,7 @@ private: friend class WebInspectorClient; friend class WebInspectorFrontendClient; - explicit WebInspector(WebPage*); + explicit WebInspector(WebPage*, WebCore::InspectorFrontendChannel*); virtual Type type() const { return APIType; } @@ -116,6 +120,7 @@ private: WebPage* m_page; WebPage* m_inspectorPage; WebInspectorFrontendClient* m_frontendClient; + WebCore::InspectorFrontendChannel* m_frontendChannel; #if PLATFORM(MAC) String m_localizedStringsURL; #endif diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp index 2cb290e50..77987f26c 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp @@ -245,6 +245,7 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters) #if ENABLE(PAGE_VISIBILITY_API) , m_visibilityState(WebCore::PageVisibilityStateVisible) #endif + , m_inspectorClient(0) { ASSERT(m_pageID); // FIXME: This is a non-ideal location for this Setting and @@ -262,7 +263,8 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters) #endif pageClients.backForwardClient = WebBackForwardListProxy::create(this); #if ENABLE(INSPECTOR) - pageClients.inspectorClient = new WebInspectorClient(this); + m_inspectorClient = new WebInspectorClient(this); + pageClients.inspectorClient = m_inspectorClient; #endif #if USE(AUTOCORRECTION_PANEL) pageClients.alternativeTextClient = new WebAlternativeTextClient(this); @@ -1339,6 +1341,10 @@ static bool handleMouseEvent(const WebMouseEvent& mouseEvent, WebPage* page, boo if (isContextClick(platformMouseEvent)) handled = handleContextMenuEvent(platformMouseEvent, page); #endif +#if PLATFORM(GTK) + bool gtkMouseButtonPressHandled = page->handleMousePressedEvent(platformMouseEvent); + handled = handled || gtkMouseButtonPressHandled; +#endif return handled; } @@ -2085,7 +2091,7 @@ WebInspector* WebPage::inspector() if (m_isClosed) return 0; if (!m_inspector) - m_inspector = WebInspector::create(this); + m_inspector = WebInspector::create(this, m_inspectorClient); return m_inspector.get(); } #endif diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.h b/Source/WebKit2/WebProcess/WebPage/WebPage.h index d234a1da4..4d20421e0 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.h +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.h @@ -131,6 +131,7 @@ class WebFrame; class WebFullScreenManager; class WebImage; class WebInspector; +class WebInspectorClient; class WebKeyboardEvent; class WebMouseEvent; class WebNotificationClient; @@ -403,6 +404,10 @@ public: SandboxExtensionTracker& sandboxExtensionTracker() { return m_sandboxExtensionTracker; } +#if PLATFORM(EFL) + void setThemePath(const String&); +#endif + #if PLATFORM(QT) void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd); void confirmComposition(const String& text, int64_t selectionStart, int64_t selectionLength); @@ -445,6 +450,7 @@ public: #elif PLATFORM(GTK) void updateAccessibilityTree(); + bool handleMousePressedEvent(const WebCore::PlatformMouseEvent&); #if USE(TEXTURE_MAPPER_GL) void widgetMapped(int64_t nativeWindowHandle); #endif @@ -871,6 +877,7 @@ private: #if ENABLE(PAGE_VISIBILITY_API) WebCore::PageVisibilityState m_visibilityState; #endif + WebInspectorClient* m_inspectorClient; }; } // namespace WebKit diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in b/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in index 75f7245f5..4c260eb90 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in @@ -230,6 +230,10 @@ messages -> WebPage { DeliverIntentToFrame(uint64_t frameID, WebKit::IntentData intentData); #endif +#if PLATFORM(EFL) + SetThemePath(WTF::String themePath) +#endif + #if PLATFORM(QT) SetComposition(WTF::String text, WTF::Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd) ConfirmComposition(WTF::String text, int64_t selectionStart, int64_t selectionLength) diff --git a/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp b/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp index df0f17f87..fa570358a 100644 --- a/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp +++ b/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp @@ -34,9 +34,11 @@ #include <WebCore/EflKeyboardUtilities.h> #include <WebCore/FocusController.h> #include <WebCore/Frame.h> +#include <WebCore/FrameView.h> #include <WebCore/KeyboardEvent.h> #include <WebCore/Page.h> #include <WebCore/PlatformKeyboardEvent.h> +#include <WebCore/RenderThemeEfl.h> #include <WebCore/Settings.h> using namespace WebCore; @@ -104,4 +106,10 @@ const char* WebPage::interpretKeyEvent(const KeyboardEvent* event) return getKeyPressCommandName(event); } +void WebPage::setThemePath(const String& themePath) +{ + WebCore::RenderThemeEfl* theme = static_cast<WebCore::RenderThemeEfl*>(m_page->theme()); + theme->setThemePath(themePath); +} + } // namespace WebKit diff --git a/Source/WebKit2/WebProcess/WebPage/gtk/WebPageGtk.cpp b/Source/WebKit2/WebProcess/WebPage/gtk/WebPageGtk.cpp index a02891cc1..30aaa4037 100644 --- a/Source/WebKit2/WebProcess/WebPage/gtk/WebPageGtk.cpp +++ b/Source/WebKit2/WebProcess/WebPage/gtk/WebPageGtk.cpp @@ -37,6 +37,7 @@ #include <WebCore/Frame.h> #include <WebCore/KeyboardEvent.h> #include <WebCore/Page.h> +#include <WebCore/PasteboardHelper.h> #include <WebCore/PlatformKeyboardEvent.h> #include <WebCore/Settings.h> #include <wtf/gobject/GOwnPtr.h> @@ -159,7 +160,31 @@ void WebPage::widgetMapped(int64_t nativeWindowHandle) { m_nativeWindowHandle = nativeWindowHandle; } +#endif + +bool WebPage::handleMousePressedEvent(const PlatformMouseEvent& platformMouseEvent) +{ + bool returnValue = false; + if (platformMouseEvent.button() != WebCore::MiddleButton) + return returnValue; + +#if PLATFORM(X11) + Frame* frame = m_page->focusController()->focusedOrMainFrame(); + if (!frame) + return returnValue; + PasteboardHelper* pasteboardHelper = PasteboardHelper::defaultPasteboardHelper(); + bool wasUsingPrimary = pasteboardHelper->usePrimarySelectionClipboard(); + pasteboardHelper->setUsePrimarySelectionClipboard(true); + + Editor* editor = frame->editor(); + returnValue = editor->canPaste() || editor->canDHTMLPaste(); + editor->paste(); + + pasteboardHelper->setUsePrimarySelectionClipboard(wasUsingPrimary); #endif + return returnValue; +} + } // namespace WebKit diff --git a/Source/WebKit2/win/WebKit2.def b/Source/WebKit2/win/WebKit2.def index 4c742953c..563758064 100644 --- a/Source/WebKit2/win/WebKit2.def +++ b/Source/WebKit2/win/WebKit2.def @@ -153,8 +153,6 @@ EXPORTS ??1ClientRectList@WebCore@@QAE@XZ ??0String@WTF@@QAE@PBD@Z ??0String@WTF@@QAE@PB_W@Z - ??1FrameDestructionObserver@WebCore@@MAE@XZ - ??0FrameDestructionObserver@WebCore@@QAE@PAVFrame@1@@Z ?absoluteBoundingBoxRect@RenderObject@WebCore@@QBE?AVIntRect@2@_N@Z ?absoluteBoundingBoxRectIgnoringTransforms@RenderObject@WebCore@@QBE?AVIntRect@2@XZ ?description@DocumentMarker@WebCore@@QBEABVString@WTF@@XZ @@ -174,7 +172,6 @@ EXPORTS ?externalRepresentation@WebCore@@YA?AVString@WTF@@PAVElement@1@I@Z ?find@StringImpl@WTF@@QAEIPAV12@I@Z ?find@StringImpl@WTF@@QAEIPAV12@@Z - ?frameDestroyed@FrameDestructionObserver@WebCore@@UAEXXZ ?absoluteCaretBounds@FrameSelection@WebCore@@QAE?AVIntRect@2@XZ ?fromUTF8WithLatin1Fallback@String@WTF@@SA?AV12@PBEI@Z ?getCachedDOMStructure@WebCore@@YAPAVStructure@JSC@@PAVJSDOMGlobalObject@1@PBUClassInfo@3@@Z @@ -197,7 +194,6 @@ EXPORTS ?previous@ComposedShadowTreeWalker@WebCore@@QAEXXZ ?number@String@WTF@@SA?AV12@I@Z ?number@String@WTF@@SA?AV12@H@Z - ?observeFrame@FrameDestructionObserver@WebCore@@IAEXPAVFrame@2@@Z ?overrideUserPreferredLanguages@WebCore@@YAXABV?$Vector@VString@WTF@@$0A@@WTF@@@Z ?numberOfScopedHTMLStyleChildren@Node@WebCore@@QBEIXZ ?page@Document@WebCore@@QBEPAVPage@2@XZ @@ -254,7 +250,6 @@ EXPORTS ?userPreferredLanguages@WebCore@@YA?AV?$Vector@VString@WTF@@$0A@@WTF@@XZ ?utf8@String@WTF@@QBE?AVCString@2@_N@Z ?view@Document@WebCore@@QBEPAVFrameView@2@XZ - ?willDetachPage@FrameDestructionObserver@WebCore@@UAEXXZ ??1ContextDestructionObserver@WebCore@@MAE@XZ ?contextDestroyed@ContextDestructionObserver@WebCore@@UAEXXZ ??0ContextDestructionObserver@WebCore@@QAE@PAVScriptExecutionContext@1@@Z @@ -278,3 +273,4 @@ EXPORTS ?jsStringSlowCase@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@AAV?$HashMap@PAVStringImpl@WTF@@V?$Weak@VJSString@JSC@@@JSC@@U?$PtrHash@PAVStringImpl@WTF@@@2@U?$HashTraits@PAVStringImpl@WTF@@@2@U?$HashTraits@V?$Weak@VJSString@JSC@@@JSC@@@2@@WTF@@PAVStringImpl@6@@Z ?registerURLSchemeAsBypassingContentSecurityPolicy@SchemeRegistry@WebCore@@SAXABVString@WTF@@@Z ?removeURLSchemeRegisteredAsBypassingContentSecurityPolicy@SchemeRegistry@WebCore@@SAXABVString@WTF@@@Z + ?iconURLs@Document@WebCore@@QAEABV?$Vector@UIconURL@WebCore@@$0A@@WTF@@XZ
\ No newline at end of file diff --git a/Source/WebKit2/win/WebKit2CFLite.def b/Source/WebKit2/win/WebKit2CFLite.def index fb51f6223..0e5d1b2c7 100644 --- a/Source/WebKit2/win/WebKit2CFLite.def +++ b/Source/WebKit2/win/WebKit2CFLite.def @@ -146,8 +146,6 @@ EXPORTS ??1ClientRectList@WebCore@@QAE@XZ ??0String@WTF@@QAE@PBD@Z ??0String@WTF@@QAE@PB_W@Z - ??1FrameDestructionObserver@WebCore@@MAE@XZ - ??0FrameDestructionObserver@WebCore@@QAE@PAVFrame@1@@Z ??1ContextDestructionObserver@WebCore@@MAE@XZ ?contextDestroyed@ContextDestructionObserver@WebCore@@UAEXXZ ??0ContextDestructionObserver@WebCore@@QAE@PAVScriptExecutionContext@1@@Z @@ -170,7 +168,6 @@ EXPORTS ?externalRepresentation@WebCore@@YA?AVString@WTF@@PAVElement@1@I@Z ?find@StringImpl@WTF@@QAEIPAV12@I@Z ?find@StringImpl@WTF@@QAEIPAV12@@Z - ?frameDestroyed@FrameDestructionObserver@WebCore@@UAEXXZ ?absoluteCaretBounds@FrameSelection@WebCore@@QAE?AVIntRect@2@XZ ?fromUTF8WithLatin1Fallback@String@WTF@@SA?AV12@PBEI@Z ?getCachedDOMStructure@WebCore@@YAPAVStructure@JSC@@PAVJSDOMGlobalObject@1@PBUClassInfo@3@@Z @@ -193,7 +190,6 @@ EXPORTS ?previous@ComposedShadowTreeWalker@WebCore@@QAEXXZ ?number@String@WTF@@SA?AV12@I@Z ?number@String@WTF@@SA?AV12@H@Z - ?observeFrame@FrameDestructionObserver@WebCore@@IAEXPAVFrame@2@@Z ?overrideUserPreferredLanguages@WebCore@@YAXABV?$Vector@VString@WTF@@$0A@@WTF@@@Z ?numberOfScopedHTMLStyleChildren@Node@WebCore@@QBEIXZ ?page@Document@WebCore@@QBEPAVPage@2@XZ @@ -250,7 +246,6 @@ EXPORTS ?userPreferredLanguages@WebCore@@YA?AV?$Vector@VString@WTF@@$0A@@WTF@@XZ ?utf8@String@WTF@@QBE?AVCString@2@_N@Z ?view@Document@WebCore@@QBEPAVFrameView@2@XZ - ?willDetachPage@FrameDestructionObserver@WebCore@@UAEXXZ ?nodesFromRect@Document@WebCore@@QBE?AV?$PassRefPtr@VNodeList@WebCore@@@WTF@@HHIIII_N0@Z ?selectionStartHasMarkerFor@Editor@WebCore@@QBE_NW4MarkerType@DocumentMarker@2@HH@Z ?restrictScaleFactorToInitialScaleIfNotUserScalable@WebCore@@YAXAAUViewportAttributes@1@@Z |