diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-07 11:22:47 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-07 11:22:47 +0100 |
commit | cfd86b747d32ac22246a1aa908eaa720c63a88c1 (patch) | |
tree | 24d68c6f61c464ecba1e05670b80390ea3b0e50c /Source/WebKit/efl | |
parent | 69d7c744c9de19d152dbe2d8e46eb7dfd4511d1a (diff) | |
download | qtwebkit-cfd86b747d32ac22246a1aa908eaa720c63a88c1.tar.gz |
Imported WebKit commit 20271caf2e2c016d5cef40184cddeefeac4f1876 (http://svn.webkit.org/repository/webkit/trunk@133733)
New snapshot that contains all previous fixes as well as build fix for latest QtMultimedia API changes.
Diffstat (limited to 'Source/WebKit/efl')
-rw-r--r-- | Source/WebKit/efl/ChangeLog | 142 | ||||
-rwxr-xr-x | Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.cpp | 2 | ||||
-rw-r--r-- | Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp | 10 | ||||
-rw-r--r-- | Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp | 96 | ||||
-rw-r--r-- | Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h | 13 | ||||
-rw-r--r-- | Source/WebKit/efl/WebCoreSupport/PlatformStrategiesEfl.cpp | 20 | ||||
-rw-r--r-- | Source/WebKit/efl/WebCoreSupport/PlatformStrategiesEfl.h | 8 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_contextmenu.cpp | 17 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_contextmenu.h | 11 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_view.cpp | 138 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_view.h | 12 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_view_private.h | 6 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_view_single.cpp | 14 | ||||
-rw-r--r-- | Source/WebKit/efl/tests/test_ewk_contextmenu.cpp | 124 | ||||
-rw-r--r-- | Source/WebKit/efl/tests/test_ewk_view.cpp | 32 |
15 files changed, 607 insertions, 38 deletions
diff --git a/Source/WebKit/efl/ChangeLog b/Source/WebKit/efl/ChangeLog index e84aa244b..b2e8a8fd7 100644 --- a/Source/WebKit/efl/ChangeLog +++ b/Source/WebKit/efl/ChangeLog @@ -1,3 +1,145 @@ +2012-11-01 Seonae Kim <sunaeluv.kim@samsung.com> + + [EFL][DRT] Support Geolocation + https://bugs.webkit.org/show_bug.cgi?id=97427 + + Reviewed by Gyuyoung Kim. + + Implement methods to use GeolocationClientMock in DumpRenderTree. + This client attaches to the page whenever a view is created. + + * WebCoreSupport/DumpRenderTreeSupportEfl.cpp: + (DumpRenderTreeSupportEfl::attachClientToPage): + (DumpRenderTreeSupportEfl::resetGeolocationClientMock): + (DumpRenderTreeSupportEfl::setMockGeolocationPermission): + (DumpRenderTreeSupportEfl::setMockGeolocationPosition): + (DumpRenderTreeSupportEfl::setMockGeolocationPositionUnavailableError): + (DumpRenderTreeSupportEfl::numberOfPendingGeolocationPermissionRequests): + * WebCoreSupport/DumpRenderTreeSupportEfl.h: + +2012-10-31 Michał Pakuła vel Rutka <m.pakula@samsung.com> + + [EFL][DRT] EventSender requires contextClick implementation + https://bugs.webkit.org/show_bug.cgi?id=86091 + + Reviewed by Gyuyoung Kim. + + Add a pointer to parent menu in Ewk_Context_Menu_Item and a getter + function to allow selecting a context menu item without having + parent menu pointer in DumpRenderTree EventSender. + Three unit tests added due ewk API changes. + + * ewk/ewk_contextmenu.cpp: + (_Ewk_Context_Menu_Item): + (ewk_context_menu_item_new): + (ewk_context_menu_item_parent_get): + (ewk_context_menu_item_append): + * ewk/ewk_contextmenu.h: + * ewk/ewk_view.cpp: + (ewk_view_context_menu_get): + * ewk/ewk_view.h: + * tests/test_ewk_contextmenu.cpp: Added. + (TEST_F): + * tests/test_ewk_view.cpp: + (TEST_F): + +2012-10-30 Seokju Kwon <seokju.kwon@samsung.com> + + [EFL] Fix failure to highlight nodes on web inspector + https://bugs.webkit.org/show_bug.cgi?id=100303 + + Reviewed by Gyuyoung Kim. + + It is not working to highlight nodes on web inspector + when using 'Single Backing Store'. + Add code for drawing it if there is the highlighted node. + + * ewk/ewk_view_single.cpp: + (_ewk_view_single_smart_repaints_process): + +2012-10-30 Jinwoo Song <jinwoo7.song@samsung.com> + + [EFL] Refactor tooltip callback signal in WebKit1 + https://bugs.webkit.org/show_bug.cgi?id=100571 + + Reviewed by Gyuyoung Kim. + + Separate tooltip callback signal into 'tooltip,text,set' + and 'tooltip,text,unset' to be consistent with WebKit2. + + * ewk/ewk_view.cpp: + (ewk_view_tooltip_text_set): + * ewk/ewk_view.h: + +2012-10-26 Hyowon Kim <hw1008.kim@samsung.com> + + [Texmap][EFL] Implementation of AC related functions in ChromeClientEfl and ewkView. + https://bugs.webkit.org/show_bug.cgi?id=82315 + + Reviewed by Kenneth Rohde Christiansen. + + This patch implements accelerated-compositing-related functions + to enter accelerated-compositing mode and sync layers + in ChromeClientEfl and ewkView. + + * WebCoreSupport/ChromeClientEfl.cpp: + (WebCore::ChromeClientEfl::attachRootGraphicsLayer): + (WebCore::ChromeClientEfl::setNeedsOneShotDrawingSynchronization): + (WebCore::ChromeClientEfl::scheduleCompositingLayerFlush): + (WebCore::ChromeClientEfl::allowedCompositingTriggers): + * ewk/ewk_view.cpp: + (_Ewk_View_Private_Data): + (_ewk_view_priv_new): + (_ewk_view_priv_del): + (_ewk_view_accelerated_compositing_cb): + Sync and render layers. + (_ewk_view_accelerated_compositing_context_create_if_needed): + Create a new AcceleratedCompositingContext. + (ewk_view_accelerated_compositing_object_create): + Create a new evas_image_object act as render target surface. + (ewk_view_accelerated_compositing_context_get): + Return the GraphicsContext3D for accelerated compositing. + (ewk_view_root_graphics_layer_set): + Set the root layer to AcceleratedCompositingContext. + (ewk_view_mark_for_sync): + Mark the evas_image_object for accelerated compositing as dirty to make it update. + * ewk/ewk_view_private.h: + (WebCore): + +2012-10-24 Brady Eidson <beidson@apple.com> + + Add a strategy for loader customization. + https://bugs.webkit.org/show_bug.cgi?id=100278 + + Reviewed by Alexey Proskuryakov. + + * WebCoreSupport/PlatformStrategiesEfl.cpp: + (PlatformStrategiesEfl::createLoaderStrategy): + * WebCoreSupport/PlatformStrategiesEfl.h: + (PlatformStrategiesEfl): + +2012-10-23 Alexey Proskuryakov <ap@apple.com> + + Add a strategy for shared workers + https://bugs.webkit.org/show_bug.cgi?id=100165 + + Reviewed by Brady Eidson. + + * WebCoreSupport/PlatformStrategiesEfl.cpp: + (PlatformStrategiesEfl::createPasteboardStrategy): + (PlatformStrategiesEfl::createSharedWorkerStrategy): + (PlatformStrategiesEfl::createVisitedLinkStrategy): + * WebCoreSupport/PlatformStrategiesEfl.h: + +2012-10-23 Hyowon Kim <hw1008.kim@samsung.com> + + [Texmap][EFL] Add AcceleratedCompositingContextEfl to the build system. + https://bugs.webkit.org/show_bug.cgi?id=88630 + + Reviewed by Gyuyoung Kim. + + * WebCoreSupport/AcceleratedCompositingContextEfl.cpp: Modify the #include file. + 2012-10-23 Andras Becsi <andras.becsi@digia.com> Remove devicePixelRatio from ViewportAttributes diff --git a/Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.cpp b/Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.cpp index b1bff6486..08de3e0d0 100755 --- a/Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.cpp +++ b/Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.cpp @@ -29,7 +29,7 @@ #include "PageClientEfl.h" #include "TextureMapperGL.h" #include "TextureMapperLayer.h" -#include "ewk_private.h" +#include "ewk_view_private.h" namespace WebCore { diff --git a/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp b/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp index 1f52af33a..537424a94 100644 --- a/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp +++ b/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp @@ -591,24 +591,24 @@ PassRefPtr<SearchPopupMenu> ChromeClientEfl::createSearchPopupMenu(PopupMenuClie } #if USE(ACCELERATED_COMPOSITING) -void ChromeClientEfl::attachRootGraphicsLayer(Frame*, GraphicsLayer*) +void ChromeClientEfl::attachRootGraphicsLayer(Frame*, GraphicsLayer* rootLayer) { - notImplemented(); + ewk_view_root_graphics_layer_set(m_view, rootLayer); } void ChromeClientEfl::setNeedsOneShotDrawingSynchronization() { - notImplemented(); + ewk_view_mark_for_sync(m_view); } void ChromeClientEfl::scheduleCompositingLayerFlush() { - notImplemented(); + ewk_view_mark_for_sync(m_view); } ChromeClient::CompositingTriggerFlags ChromeClientEfl::allowedCompositingTriggers() const { - return 0; + return AllTriggers; } #endif diff --git a/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp b/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp index eee7122e7..b045ab042 100644 --- a/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp +++ b/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp @@ -62,6 +62,14 @@ #include <workers/WorkerThread.h> #include <wtf/HashMap.h> +#if ENABLE(GEOLOCATION) +#include <GeolocationClientMock.h> +#include <GeolocationController.h> +#include <GeolocationError.h> +#include <GeolocationPosition.h> +#include <wtf/CurrentTime.h> +#endif + #define DRT_SUPPORT_FRAME_GET_OR_RETURN(ewkFrame, frame, ...) \ WebCore::Frame* frame = EWKPrivate::coreFrame(ewkFrame); \ if (!frame) \ @@ -71,7 +79,19 @@ WebCore::Page* page = EWKPrivate::corePage(ewkView); \ if (!page) \ return __VA_ARGS__; - + +bool DumpRenderTreeSupportEfl::s_drtRun = false; + +void DumpRenderTreeSupportEfl::setDumpRenderTreeModeEnabled(bool enabled) +{ + s_drtRun = enabled; +} + +bool DumpRenderTreeSupportEfl::dumpRenderTreeModeEnabled() +{ + return s_drtRun; +} + unsigned DumpRenderTreeSupportEfl::activeAnimationsCount(const Evas_Object* ewkFrame) { DRT_SUPPORT_FRAME_GET_OR_RETURN(ewkFrame, frame, 0); @@ -779,3 +799,77 @@ void DumpRenderTreeSupportEfl::setDomainRelaxationForbiddenForURLScheme(bool for { WebCore::SchemeRegistry::setDomainRelaxationForbiddenForURLScheme(forbidden, scheme); } + +void DumpRenderTreeSupportEfl::resetGeolocationClientMock(const Evas_Object* ewkView) +{ +#if ENABLE(GEOLOCATION) + DRT_SUPPRT_PAGE_GET_OR_RETURN(ewkView, page); + + WebCore::GeolocationClientMock* mock = static_cast<WebCore::GeolocationClientMock*>(WebCore::GeolocationController::from(page)->client()); + mock->reset(); +#else + UNUSED_PARAM(ewkView); +#endif +} + +void DumpRenderTreeSupportEfl::setMockGeolocationPermission(const Evas_Object* ewkView, bool allowed) +{ +#if ENABLE(GEOLOCATION) + DRT_SUPPRT_PAGE_GET_OR_RETURN(ewkView, page); + + WebCore::GeolocationClientMock* mock = static_cast<WebCore::GeolocationClientMock*>(WebCore::GeolocationController::from(page)->client()); + mock->setPermission(allowed); +#else + UNUSED_PARAM(ewkView); + UNUSED_PARAM(allowed); +#endif +} + +void DumpRenderTreeSupportEfl::setMockGeolocationPosition(const Evas_Object* ewkView, double latitude, double longitude, double accuracy, bool canProvideAltitude, double altitude, bool canProvideAltitudeAccuracy, double altitudeAccuracy, bool canProvideHeading, double heading, bool canProvideSpeed, double speed) +{ +#if ENABLE(GEOLOCATION) + DRT_SUPPRT_PAGE_GET_OR_RETURN(ewkView, page); + + WebCore::GeolocationClientMock* mock = static_cast<WebCore::GeolocationClientMock*>(WebCore::GeolocationController::from(page)->client()); + mock->setPosition(WebCore::GeolocationPosition::create(currentTime(), latitude, longitude, accuracy, canProvideAltitude, altitude, canProvideAltitudeAccuracy, altitudeAccuracy, canProvideHeading, heading, canProvideSpeed, speed)); +#else + UNUSED_PARAM(ewkView); + UNUSED_PARAM(latitude); + UNUSED_PARAM(longitude); + UNUSED_PARAM(accuracy); + UNUSED_PARAM(canProvideAltitude); + UNUSED_PARAM(altitude); + UNUSED_PARAM(canProvideAltitudeAccuracy); + UNUSED_PARAM(altitudeAccuracy); + UNUSED_PARAM(canProvideHeading); + UNUSED_PARAM(heading); + UNUSED_PARAM(canProvideSpeed); + UNUSED_PARAM(speed); +#endif +} + +void DumpRenderTreeSupportEfl::setMockGeolocationPositionUnavailableError(const Evas_Object* ewkView, const char* errorMessage) +{ +#if ENABLE(GEOLOCATION) + DRT_SUPPRT_PAGE_GET_OR_RETURN(ewkView, page); + + WebCore::GeolocationClientMock* mock = static_cast<WebCore::GeolocationClientMock*>(WebCore::GeolocationController::from(page)->client()); + mock->setPositionUnavailableError(errorMessage); +#else + UNUSED_PARAM(ewkView); + UNUSED_PARAM(errorMessage); +#endif +} + +int DumpRenderTreeSupportEfl::numberOfPendingGeolocationPermissionRequests(const Evas_Object* ewkView) +{ +#if ENABLE(GEOLOCATION) + DRT_SUPPRT_PAGE_GET_OR_RETURN(ewkView, page, -1); + + WebCore::GeolocationClientMock* mock = static_cast<WebCore::GeolocationClientMock*>(WebCore::GeolocationController::from(page)->client()); + return mock->numberOfPendingPermissionRequests(); +#else + UNUSED_PARAM(ewkView); + return 0; +#endif +} diff --git a/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h b/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h index 35c05001d..59a63b4b1 100644 --- a/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h +++ b/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h @@ -49,6 +49,9 @@ public: ~DumpRenderTreeSupportEfl() { } + static void setDumpRenderTreeModeEnabled(bool); + static bool dumpRenderTreeModeEnabled(); + static unsigned activeAnimationsCount(const Evas_Object* ewkFrame); static bool callShouldCloseOnWebView(Evas_Object* ewkFrame); static void clearFrameName(Evas_Object* ewkFrame); @@ -127,6 +130,16 @@ public: static void confirmComposition(Evas_Object*, const char*); static WebCore::IntRect firstRectForCharacterRange(Evas_Object*, int, int); static bool selectedRange(Evas_Object*, int*, int*); + + // Geolocation + static void resetGeolocationClientMock(const Evas_Object*); + static void setMockGeolocationPermission(const Evas_Object*, bool allowed); + static void setMockGeolocationPosition(const Evas_Object*, double latitude, double longitude, double accuracy, bool canProvideAltitude, double altitude, bool canProvideAltitudeAccuracy, double altitudeAccuracy, bool canProvideHeading, double heading, bool canProvideSpeed, double speed); + static void setMockGeolocationPositionUnavailableError(const Evas_Object*, const char* errorMessage); + static int numberOfPendingGeolocationPermissionRequests(const Evas_Object*); + +private: + static bool s_drtRun; }; #endif // DumpRenderTreeSupportEfl_h diff --git a/Source/WebKit/efl/WebCoreSupport/PlatformStrategiesEfl.cpp b/Source/WebKit/efl/WebCoreSupport/PlatformStrategiesEfl.cpp index c262085c3..7138aa8d7 100644 --- a/Source/WebKit/efl/WebCoreSupport/PlatformStrategiesEfl.cpp +++ b/Source/WebKit/efl/WebCoreSupport/PlatformStrategiesEfl.cpp @@ -44,27 +44,35 @@ PlatformStrategiesEfl::PlatformStrategiesEfl() { } -// CookiesStrategy CookiesStrategy* PlatformStrategiesEfl::createCookiesStrategy() { return this; } -// PluginStrategy +LoaderStrategy* PlatformStrategiesEfl::createLoaderStrategy() +{ + return this; +} + +PasteboardStrategy* PlatformStrategiesEfl::createPasteboardStrategy() +{ + notImplemented(); + return 0; +} + PluginStrategy* PlatformStrategiesEfl::createPluginStrategy() { return this; } -VisitedLinkStrategy* PlatformStrategiesEfl::createVisitedLinkStrategy() +SharedWorkerStrategy* PlatformStrategiesEfl::createSharedWorkerStrategy() { return this; } -PasteboardStrategy* PlatformStrategiesEfl::createPasteboardStrategy() +VisitedLinkStrategy* PlatformStrategiesEfl::createVisitedLinkStrategy() { - notImplemented(); - return 0; + return this; } // CookiesStrategy diff --git a/Source/WebKit/efl/WebCoreSupport/PlatformStrategiesEfl.h b/Source/WebKit/efl/WebCoreSupport/PlatformStrategiesEfl.h index d3f26b680..01e61156c 100644 --- a/Source/WebKit/efl/WebCoreSupport/PlatformStrategiesEfl.h +++ b/Source/WebKit/efl/WebCoreSupport/PlatformStrategiesEfl.h @@ -21,12 +21,14 @@ #define PlatformStrategiesEfl_h #include "CookiesStrategy.h" +#include "LoaderStrategy.h" #include "PasteboardStrategy.h" #include "PlatformStrategies.h" #include "PluginStrategy.h" +#include "SharedWorkerStrategy.h" #include "VisitedLinkStrategy.h" -class PlatformStrategiesEfl : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::PluginStrategy, private WebCore::VisitedLinkStrategy { +class PlatformStrategiesEfl : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::LoaderStrategy, private WebCore::PluginStrategy, private WebCore::SharedWorkerStrategy, private WebCore::VisitedLinkStrategy { public: static void initialize(); @@ -35,9 +37,11 @@ private: // WebCore::PlatformStrategies virtual WebCore::CookiesStrategy* createCookiesStrategy(); + virtual WebCore::LoaderStrategy* createLoaderStrategy(); + virtual WebCore::PasteboardStrategy* createPasteboardStrategy(); virtual WebCore::PluginStrategy* createPluginStrategy(); + virtual WebCore::SharedWorkerStrategy* createSharedWorkerStrategy(); virtual WebCore::VisitedLinkStrategy* createVisitedLinkStrategy(); - virtual WebCore::PasteboardStrategy* createPasteboardStrategy(); // WebCore::CookiesStrategy virtual void notifyCookiesChanged(); diff --git a/Source/WebKit/efl/ewk/ewk_contextmenu.cpp b/Source/WebKit/efl/ewk/ewk_contextmenu.cpp index e792c6d03..c4ad4533a 100644 --- a/Source/WebKit/efl/ewk/ewk_contextmenu.cpp +++ b/Source/WebKit/efl/ewk/ewk_contextmenu.cpp @@ -53,6 +53,7 @@ struct _Ewk_Context_Menu_Item { const char* title; /**< contains the title of the item */ Ewk_Context_Menu* submenu; /**< contains the pointer to the submenu of the item */ + Ewk_Context_Menu* parentMenu; /**< contains the pointer to parent menu of the item */ bool checked : 1; bool enabled : 1; @@ -98,14 +99,14 @@ const Eina_List* ewk_context_menu_item_list_get(const Ewk_Context_Menu* menu) return menu->items; } -Ewk_Context_Menu_Item* ewk_context_menu_item_new(Ewk_Context_Menu_Item_Type type, - Ewk_Context_Menu_Action action, Ewk_Context_Menu* submenu, - const char* title, Eina_Bool checked, Eina_Bool enabled) +Ewk_Context_Menu_Item* ewk_context_menu_item_new(Ewk_Context_Menu_Item_Type type, Ewk_Context_Menu_Action action, Ewk_Context_Menu* parentMenu, + Ewk_Context_Menu* submenu, const char* title, Eina_Bool checked, Eina_Bool enabled) { Ewk_Context_Menu_Item* item = new Ewk_Context_Menu_Item; item->type = type; item->action = action; item->title = eina_stringshare_add(title); + item->parentMenu = parentMenu; item->submenu = submenu; item->checked = checked; item->enabled = enabled; @@ -203,6 +204,12 @@ Eina_Bool ewk_context_menu_item_enabled_set(Ewk_Context_Menu_Item* item, Eina_Bo return true; } +Ewk_Context_Menu* ewk_context_menu_item_parent_get(const Ewk_Context_Menu_Item* item) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(item, 0); + + return item->parentMenu; +} /* internal methods ****************************************************/ @@ -276,9 +283,7 @@ void ewk_context_menu_item_append(Ewk_Context_Menu* menu, const WebCore::Context Ewk_Context_Menu_Item_Type type = static_cast<Ewk_Context_Menu_Item_Type>(core.type()); Ewk_Context_Menu_Action action = static_cast<Ewk_Context_Menu_Action>(core.action()); - Ewk_Context_Menu_Item* menu_item = ewk_context_menu_item_new - (type, action, 0, core.title().utf8().data(), core.checked(), - core.enabled()); + Ewk_Context_Menu_Item* menu_item = ewk_context_menu_item_new(type, action, menu, 0, core.title().utf8().data(), core.checked(), core.enabled()); EINA_SAFETY_ON_NULL_RETURN(menu_item); menu->items = eina_list_append(menu->items, menu_item); diff --git a/Source/WebKit/efl/ewk/ewk_contextmenu.h b/Source/WebKit/efl/ewk/ewk_contextmenu.h index af6d4a8b7..49ebad929 100644 --- a/Source/WebKit/efl/ewk/ewk_contextmenu.h +++ b/Source/WebKit/efl/ewk/ewk_contextmenu.h @@ -192,6 +192,7 @@ EAPI const Eina_List *ewk_context_menu_item_list_get(const Ewk_Contex * * @param type specifies a type of the item * @param action specifies a action of the item + * @param parent_menu specifies a parent menu of the item * @param submenu specifies a submenu of the item * @param title specifies a title of the item * @param checked @c EINA_TRUE if the item should be toggled or @c EINA_FALSE if not @@ -200,7 +201,7 @@ EAPI const Eina_List *ewk_context_menu_item_list_get(const Ewk_Contex * * @note The return value @b should @b be freed after use. */ -EAPI Ewk_Context_Menu_Item *ewk_context_menu_item_new(Ewk_Context_Menu_Item_Type type, Ewk_Context_Menu_Action action, Ewk_Context_Menu *submenu, const char *title, Eina_Bool checked, Eina_Bool enabled); +EAPI Ewk_Context_Menu_Item *ewk_context_menu_item_new(Ewk_Context_Menu_Item_Type type, Ewk_Context_Menu_Action action, Ewk_Context_Menu *parent_menu, Ewk_Context_Menu *submenu, const char *title, Eina_Bool checked, Eina_Bool enabled); /** * Destroys the item of the context menu object. @@ -322,6 +323,14 @@ EAPI Eina_Bool ewk_context_menu_item_enabled_get(const Ewk_Con */ EAPI Eina_Bool ewk_context_menu_item_enabled_set(Ewk_Context_Menu_Item *o, Eina_Bool enabled); +/** + * Gets the parent menu for context menu item. + * + * @param o the context menu item object + * @return a context menu object on success or @c NULL on failure + */ +EAPI Ewk_Context_Menu *ewk_context_menu_item_parent_get(const Ewk_Context_Menu_Item *o); + #ifdef __cplusplus } #endif diff --git a/Source/WebKit/efl/ewk/ewk_view.cpp b/Source/WebKit/efl/ewk/ewk_view.cpp index 392199c11..faa55c202 100644 --- a/Source/WebKit/efl/ewk/ewk_view.cpp +++ b/Source/WebKit/efl/ewk/ewk_view.cpp @@ -31,6 +31,7 @@ #include "ContextMenuController.h" #include "DocumentLoader.h" #include "DragClientEfl.h" +#include "DumpRenderTreeSupportEfl.h" #include "EditorClientEfl.h" #include "EflScreenUtilities.h" #include "EventHandler.h" @@ -85,6 +86,11 @@ #include "DeviceOrientationClientEfl.h" #endif +#if ENABLE(GEOLOCATION) +#include "GeolocationClientMock.h" +#include "GeolocationController.h" +#endif + #if ENABLE(VIBRATION) #include "VibrationClientEfl.h" #endif @@ -94,7 +100,7 @@ #endif #if USE(ACCELERATED_COMPOSITING) -#include "NotImplemented.h" +#include "AcceleratedCompositingContextEfl.h" #endif #if ENABLE(NETWORK_INFO) @@ -158,6 +164,7 @@ static const Evas_Smart_Cb_Description _ewk_view_callback_names[] = { { "toolbars,visible,get", "b" }, { "toolbars,visible,set", "b" }, { "tooltip,text,set", "s" }, + { "tooltip,text,unset", "s" }, { "uri,changed", "s" }, { "view,resized", "" }, { "zoom,animated,end", "" }, @@ -250,6 +257,11 @@ struct _Ewk_View_Private_Data { WebCore::ViewportArguments viewportArguments; Ewk_History* history; OwnPtr<PageClientEfl> pageClient; +#if USE(ACCELERATED_COMPOSITING) + OwnPtr<WebCore::AcceleratedCompositingContext> acceleratedCompositingContext; + bool isCompositingActive; + RefPtr<Evas_Object> compositingObject; +#endif #if ENABLE(NETWORK_INFO) OwnPtr<WebCore::NetworkInfoClientEfl> networkInfoClient; #endif @@ -778,6 +790,14 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* smartData) WebCore::provideNavigatorContentUtilsTo(priv->page.get(), priv->navigatorContentUtilsClient.get()); #endif +#if ENABLE(GEOLOCATION) + if (DumpRenderTreeSupportEfl::dumpRenderTreeModeEnabled()) { + WebCore::GeolocationClientMock* mock = new WebCore::GeolocationClientMock; + WebCore::provideGeolocationTo(priv->page.get(), mock); + mock->setController(WebCore::GeolocationController::from(priv->page.get())); + } +#endif + priv->pageSettings = priv->page->settings(); WebCore::LayoutMilestones layoutMilestones = WebCore::DidFirstLayout | WebCore::DidFirstVisuallyNonEmptyLayout; @@ -907,6 +927,10 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* smartData) priv->contextMenu = 0; +#if USE(ACCELERATED_COMPOSITING) + priv->isCompositingActive = false; +#endif + return priv; } @@ -943,6 +967,10 @@ static void _ewk_view_priv_del(Ewk_View_Private_Data* priv) if (priv->contextMenu) ewk_context_menu_free(priv->contextMenu); +#if USE(ACCELERATED_COMPOSITING) + priv->acceleratedCompositingContext = nullptr; +#endif + delete priv; } @@ -3478,18 +3506,14 @@ void ewk_view_menubar_visible_get(Evas_Object* ewkView, bool* visible) /** * @internal - * Set tooltip text and display if it is currently hidden. - * - * @param ewkView View. - * @param text Text to set tooltip to. - * - * Emits signal: "tooltip,text,set" with a string. If tooltip must be actually - * removed, text will be 0 or '\0' */ void ewk_view_tooltip_text_set(Evas_Object* ewkView, const char* text) { DBG("ewkView=%p text=%s", ewkView, text); - evas_object_smart_callback_call(ewkView, "tooltip,text,set", (void*)text); + if (text && *text) + evas_object_smart_callback_call(ewkView, "tooltip,text,set", (void*)text); + else + evas_object_smart_callback_call(ewkView, "tooltip,text,unset", 0); } /** @@ -4494,16 +4518,92 @@ void ewk_view_inspector_view_set(Evas_Object* ewkView, Evas_Object* inspectorVie } #if USE(ACCELERATED_COMPOSITING) -bool ewk_view_accelerated_compositing_object_create(Evas_Object*, Evas_Native_Surface*, const WebCore::IntRect& /*rect*/) +void _ewk_view_accelerated_compositing_cb(void* data, Evas_Object*) { - notImplemented(); - return false; + Ewk_View_Private_Data* priv = static_cast<Ewk_View_Private_Data*>(data); + + if (priv->isCompositingActive) { + priv->acceleratedCompositingContext->syncLayersNow(); + priv->acceleratedCompositingContext->renderLayers(); + } } -WebCore::GraphicsContext3D* ewk_view_accelerated_compositing_context_get(Evas_Object*) +void _ewk_view_accelerated_compositing_context_create_if_needed(Evas_Object* ewkView) { - notImplemented(); - return 0; + EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData); + EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv); + + if (!priv->acceleratedCompositingContext) + priv->acceleratedCompositingContext = WebCore::AcceleratedCompositingContext::create(priv->page->chrome()); +} + +bool ewk_view_accelerated_compositing_object_create(Evas_Object* ewkView, Evas_Native_Surface* nativeSurface, const WebCore::IntRect& rect) +{ + EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false); + EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false); + + if (!priv->compositingObject) { + priv->compositingObject = evas_object_image_add(smartData->base.evas); + + evas_object_pass_events_set(priv->compositingObject.get(), true); // Just for rendering, ignore events. + evas_object_image_alpha_set(priv->compositingObject.get(), true); + evas_object_image_content_hint_set(priv->compositingObject.get(), EVAS_IMAGE_CONTENT_HINT_DYNAMIC); + + // Set the pixel get callback. + evas_object_image_pixels_get_callback_set(priv->compositingObject.get(), _ewk_view_accelerated_compositing_cb, priv); + + evas_object_smart_member_add(priv->compositingObject.get(), ewkView); + } + + evas_object_image_size_set(priv->compositingObject.get(), rect.width(), rect.height()); + evas_object_image_fill_set(priv->compositingObject.get(), 0, 0, rect.width(), rect.height()); + + evas_object_move(priv->compositingObject.get(), rect.x(), rect.y()); + evas_object_resize(priv->compositingObject.get(), rect.width(), rect.height()); + evas_object_hide(priv->compositingObject.get()); + + // Set up the native surface info to use the context and surface created in GC3DPrivate. + evas_object_image_native_surface_set(priv->compositingObject.get(), nativeSurface); + return true; +} + +WebCore::GraphicsContext3D* ewk_view_accelerated_compositing_context_get(Evas_Object* ewkView) +{ + EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0); + EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, 0); + + _ewk_view_accelerated_compositing_context_create_if_needed(ewkView); + return priv->acceleratedCompositingContext->context(); +} + +void ewk_view_root_graphics_layer_set(Evas_Object* ewkView, WebCore::GraphicsLayer* rootLayer) +{ + EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData); + EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv); + + bool active = !!rootLayer; + if (priv->isCompositingActive == active) + return; + + priv->isCompositingActive = active; + + if (priv->isCompositingActive) { + _ewk_view_accelerated_compositing_context_create_if_needed(ewkView); + evas_object_show(priv->compositingObject.get()); + } else + evas_object_hide(priv->compositingObject.get()); + + priv->acceleratedCompositingContext->attachRootGraphicsLayer(rootLayer); +} + +void ewk_view_mark_for_sync(Evas_Object* ewkView) +{ + EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData); + EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv); + + // Mark the image as "dirty" meaning it needs an update next time evas renders. + // It will call the pixel get callback then. + evas_object_image_pixels_dirty_set(priv->compositingObject.get(), true); } #endif @@ -4647,6 +4747,14 @@ void ewk_view_fullscreen_exit(const Evas_Object* ewkView) } #endif +Ewk_Context_Menu* ewk_view_context_menu_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->contextMenu; +} + namespace EWKPrivate { WebCore::Page* corePage(const Evas_Object* ewkView) diff --git a/Source/WebKit/efl/ewk/ewk_view.h b/Source/WebKit/efl/ewk/ewk_view.h index c1a819fa3..106ba145e 100644 --- a/Source/WebKit/efl/ewk/ewk_view.h +++ b/Source/WebKit/efl/ewk/ewk_view.h @@ -103,7 +103,8 @@ * will be deleted. * - "restore", Evas_Object *: reports that view should be restored to default conditions * and it gives a frame that originated restore as an argument. - * - "tooltip,text,set", const char*: sets tooltip text and displays if it is currently hidden. + * - "tooltip,text,set", const char*: tooltip was set. + * - "tooltip,text,unset", void: tooltip was unset. * - "uri,changed", const char*: uri of the main frame was changed. * - "view,resized", void: view object's size was changed. * - "viewport,changed", void: reports that viewport was changed. @@ -113,6 +114,7 @@ #ifndef ewk_view_h #define ewk_view_h +#include "ewk_contextmenu.h" #include "ewk_file_chooser.h" #include "ewk_frame.h" #include "ewk_history.h" @@ -2774,6 +2776,14 @@ EAPI Eina_Bool ewk_view_setting_enable_fullscreen_set(Evas_Object *o, Eina_Bool */ EAPI Eina_Bool ewk_view_setting_enable_fullscreen_get(const Evas_Object *o); +/** + * Gets the context menu object. + * @param o The view that contains context menu. + * + * @return context menu structure on success or @c NULL on failure + */ +EAPI Ewk_Context_Menu *ewk_view_context_menu_get(const Evas_Object *o); + #ifdef __cplusplus } #endif diff --git a/Source/WebKit/efl/ewk/ewk_view_private.h b/Source/WebKit/efl/ewk/ewk_view_private.h index df7855d41..babd1eaa4 100644 --- a/Source/WebKit/efl/ewk/ewk_view_private.h +++ b/Source/WebKit/efl/ewk/ewk_view_private.h @@ -35,6 +35,10 @@ class ColorChooserClient; #endif class Cursor; +#if USE(ACCELERATED_COMPOSITING) +class GraphicsContext3D; +class GraphicsLayer; +#endif class PopupMenuClient; } @@ -154,6 +158,8 @@ void ewk_view_mixed_content_run_set(Evas_Object* ewkView, bool hasRun); #if USE(ACCELERATED_COMPOSITING) bool ewk_view_accelerated_compositing_object_create(Evas_Object* ewkView, Evas_Native_Surface* nativeSurface, const WebCore::IntRect& rect); WebCore::GraphicsContext3D* ewk_view_accelerated_compositing_context_get(Evas_Object* ewkView); +void ewk_view_root_graphics_layer_set(Evas_Object* ewkView, WebCore::GraphicsLayer* rootLayer); +void ewk_view_mark_for_sync(Evas_Object* ewkView); #endif #if ENABLE(FULLSCREEN_API) diff --git a/Source/WebKit/efl/ewk/ewk_view_single.cpp b/Source/WebKit/efl/ewk/ewk_view_single.cpp index 294bbc8e1..de0eb897c 100644 --- a/Source/WebKit/efl/ewk/ewk_view_single.cpp +++ b/Source/WebKit/efl/ewk/ewk_view_single.cpp @@ -30,6 +30,11 @@ #include <eina_safety_checks.h> #include <string.h> +#if ENABLE(INSPECTOR) +#include "InspectorController.h" +#include "Page.h" +#endif + static Ewk_View_Smart_Class _parent_sc = EWK_VIEW_SMART_CLASS_INIT_NULL; static void _ewk_view_single_on_del(void* data, Evas*, Evas_Object*, void*) @@ -266,6 +271,15 @@ static Eina_Bool _ewk_view_single_smart_repaints_process(Ewk_View_Smart_Data* sm evas_object_image_data_update_add(smartData->backing_store, rect->x, rect->y, rect->w, rect->h); } +#if ENABLE(INSPECTOR) + WebCore::Page* page = EWKPrivate::corePage(smartData->self); + if (page) { + WebCore::InspectorController* controller = page->inspectorController(); + if (controller->highlightedNode()) + controller->drawHighlight(*context->graphicContext); + } +#endif + ewk_paint_context_restore(context); ewk_paint_context_free(context); diff --git a/Source/WebKit/efl/tests/test_ewk_contextmenu.cpp b/Source/WebKit/efl/tests/test_ewk_contextmenu.cpp new file mode 100644 index 000000000..02940e192 --- /dev/null +++ b/Source/WebKit/efl/tests/test_ewk_contextmenu.cpp @@ -0,0 +1,124 @@ +/* + Copyright (C) 2012 Samsung Electronics + + 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "config.h" + +#include "UnitTestUtils/EWKTestBase.h" +#include "UnitTestUtils/EWKTestConfig.h" +#include <EWebKit.h> +#include <Ecore.h> +#include <wtf/OwnPtr.h> +#include <wtf/PassOwnPtr.h> + +using namespace EWKUnitTests; + +/** + * @brief Checking whether function creates proper menu item. + * + * This test creates a menu item and checks if all menu item's attributes are + * the same as passed to tested function. + */ +TEST_F(EWKTestBase, ewk_context_menu_item_new) +{ + loadUrl(); + + Evas* evas = evas_object_evas_get(webView()); + ASSERT_TRUE(evas); + + Evas_Event_Mouse_Down mouseDown; + mouseDown.button = 3; + mouseDown.output.x = 0; + mouseDown.output.y = 0; + mouseDown.canvas.x = 0; + mouseDown.canvas.y = 0; + mouseDown.data = 0; + mouseDown.modifiers = const_cast<Evas_Modifier*>(evas_key_modifier_get(evas)); + mouseDown.locks = const_cast<Evas_Lock*>(evas_key_lock_get(evas)); + mouseDown.flags = EVAS_BUTTON_NONE; + mouseDown.timestamp = ecore_loop_time_get(); + mouseDown.event_flags = EVAS_EVENT_FLAG_NONE; + mouseDown.dev = 0; + + ASSERT_TRUE(ewk_view_context_menu_forward_event(webView(), &mouseDown)); + + Ewk_Context_Menu* contextMenu = ewk_view_context_menu_get(webView()); + + ASSERT_TRUE(contextMenu); + + Ewk_Context_Menu_Item_Type itemType = EWK_ACTION_TYPE; + Ewk_Context_Menu_Action itemAction = EWK_CONTEXT_MENU_ITEM_CUSTOM_TAG_NO_ACTION; + const char* itemTitle = "Test Item"; + bool itemChecked = false; + bool itemEnabled = false; + + Ewk_Context_Menu_Item* contextMenuItem = ewk_context_menu_item_new(itemType, itemAction, contextMenu, 0, itemTitle, itemChecked, itemEnabled); + + ASSERT_TRUE(contextMenuItem); + + EXPECT_EQ(itemType, ewk_context_menu_item_type_get(contextMenuItem)); + EXPECT_EQ(itemAction, ewk_context_menu_item_action_get(contextMenuItem)); + EXPECT_EQ(contextMenu, ewk_context_menu_item_parent_get(contextMenuItem)); + EXPECT_STREQ(itemTitle, ewk_context_menu_item_title_get(contextMenuItem)); + EXPECT_EQ(itemChecked, ewk_context_menu_item_checked_get(contextMenuItem)); + EXPECT_EQ(itemEnabled, ewk_context_menu_item_enabled_get(contextMenuItem)); + + ewk_context_menu_item_free(contextMenuItem); +} + +/** + * @brief Checking whether function returns proper parent menu. + * + * This test creates a context menus, and checks if created context menu's + * parent is the same for each of menu items. + */ +TEST_F(EWKTestBase, ewk_context_menu_item_parent_get) +{ + loadUrl(); + + Evas* evas = evas_object_evas_get(webView()); + ASSERT_TRUE(evas); + + Evas_Event_Mouse_Down mouseDown; + mouseDown.button = 3; + mouseDown.output.x = 0; + mouseDown.output.y = 0; + mouseDown.canvas.x = 0; + mouseDown.canvas.y = 0; + mouseDown.data = 0; + mouseDown.modifiers = const_cast<Evas_Modifier*>(evas_key_modifier_get(evas)); + mouseDown.locks = const_cast<Evas_Lock*>(evas_key_lock_get(evas)); + mouseDown.flags = EVAS_BUTTON_NONE; + mouseDown.timestamp = ecore_loop_time_get(); + mouseDown.event_flags = EVAS_EVENT_FLAG_NONE; + mouseDown.dev = 0; + + ASSERT_TRUE(ewk_view_context_menu_forward_event(webView(), &mouseDown)); + + Ewk_Context_Menu* contextMenu = ewk_view_context_menu_get(webView()); + + ASSERT_TRUE(contextMenu); + + const Eina_List* contextMenuItems = ewk_context_menu_item_list_get(contextMenu); + + ASSERT_TRUE(contextMenuItems); + + const Eina_List* listIterator; + void* data; + EINA_LIST_FOREACH(contextMenuItems, listIterator, data) + EXPECT_EQ(contextMenu, ewk_context_menu_item_parent_get(static_cast<Ewk_Context_Menu_Item*>(data))); +} diff --git a/Source/WebKit/efl/tests/test_ewk_view.cpp b/Source/WebKit/efl/tests/test_ewk_view.cpp index 9fa23fb00..241580182 100644 --- a/Source/WebKit/efl/tests/test_ewk_view.cpp +++ b/Source/WebKit/efl/tests/test_ewk_view.cpp @@ -70,3 +70,35 @@ TEST_F(EWKTestBase, ewk_view_setting_enable_fullscreen) ASSERT_FALSE(ewk_view_setting_enable_fullscreen_get(webView())); #endif } + +/** + * @brief Checking whether function returns proper context menu structure. + * + * This test creates a context menu and checks if context menu structure + * is not NULL; + */ +TEST_F(EWKTestBase, ewk_view_context_menu_get) +{ + loadUrl(); + + Evas* evas = evas_object_evas_get(webView()); + ASSERT_TRUE(evas); + + Evas_Event_Mouse_Down mouseDown; + mouseDown.button = 3; + mouseDown.output.x = 0; + mouseDown.output.y = 0; + mouseDown.canvas.x = 0; + mouseDown.canvas.y = 0; + mouseDown.data = 0; + mouseDown.modifiers = const_cast<Evas_Modifier*>(evas_key_modifier_get(evas)); + mouseDown.locks = const_cast<Evas_Lock*>(evas_key_lock_get(evas)); + mouseDown.flags = EVAS_BUTTON_NONE; + mouseDown.timestamp = ecore_loop_time_get(); + mouseDown.event_flags = EVAS_EVENT_FLAG_NONE; + mouseDown.dev = 0; + + ASSERT_TRUE(ewk_view_context_menu_forward_event(webView(), &mouseDown)); + + ASSERT_TRUE(ewk_view_context_menu_get(webView())); +} |