Source/WebKit2/ChangeLog

 12012-10-09 Ryuan Choi <ryuan.choi@samsung.com>
 2
 3 [EFL][WK2] Add support for IMF composition
 4 https://bugs.webkit.org/show_bug.cgi?id=89552
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Implemented basic IMF support.
 9
 10 * PlatformEfl.cmake:
 11 * Shared/NativeWebKeyboardEvent.h:
 12 (NativeWebKeyboardEvent):
 13 (WebKit::NativeWebKeyboardEvent::isFiltered):
 14 Added to determine whether current keyboard event is compositing.
 15 * Shared/efl/NativeWebKeyboardEventEfl.cpp:
 16 (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent):
 17 * UIProcess/API/efl/PageClientImpl.cpp:
 18 (WebKit::PageClientImpl::updateTextInputState):
 19 Added to change input state.
 20 * UIProcess/API/efl/PageClientImpl.h:
 21 (PageClientImpl):
 22 * UIProcess/API/efl/ewk_main.cpp:
 23 (ewk_init): Called ecore_imf_init.
 24 (ewk_shutdown): Called ecore_imf_shutdown.
 25 * UIProcess/API/efl/ewk_view.cpp:
 26 (_Ewk_View_Private_Data):
 27 (_Ewk_View_Private_Data::_Ewk_View_Private_Data):
 28 (_Ewk_View_Private_Data::~_Ewk_View_Private_Data):
 29 (_ewk_view_smart_key_down): Modified to send keyboard event to IMF.
 30 (_ewk_view_smart_mouse_up): Modified to reset input method context.
 31 (_ewk_view_preedit_changed): Added to send composition string.
 32 (_ewk_view_commit): Added to send a message that composition is finished.
 33 (_ewk_view_imf_context_create): Added to create Ecore_IMF_Context.
 34 (_ewk_view_imf_context_destroy): Added to destroy Ecore_IMF_Context.
 35 (ewk_view_text_input_state_update): Added to update input state.
 36 * UIProcess/API/efl/ewk_view_private.h:
 37 * UIProcess/PageClient.h: Moved updateTextInputState() to share with EFL port.
 38 (PageClient):
 39 * UIProcess/WebPageProxy.cpp:
 40 (WebKit::WebPageProxy::editorStateChanged):
 41 Added PLATFORM(EFL) to call updateTextInputState()
 42 * UIProcess/WebPageProxy.h:
 43 (WebPageProxy):
 44 * UIProcess/WebPageProxy.messages.in:
 45 Added HandleInputMethodKeydown message to determine whether keydown is handled.
 46 * UIProcess/efl/WebPageProxyEfl.cpp:
 47 (WebKit::WebPageProxy::handleInputMethodKeydown):
 48 Added to check whether input method handled keydown.
 49 (WebKit::WebPageProxy::confirmComposition): Added to support composition.
 50 (WebKit::WebPageProxy::setComposition): Ditto.
 51 (WebKit::WebPageProxy::cancelComposition): Ditto.
 52 * WebProcess/WebCoreSupport/efl/WebEditorClientEfl.cpp:
 53 (WebKit::WebEditorClient::handleInputMethodKeydown):
 54 Added to check whether input method handled keydown.
 55 * WebProcess/WebPage/WebPage.h:
 56 (WebPage):
 57 * WebProcess/WebPage/WebPage.messages.in: Added messages to support composition.
 58 * WebProcess/WebPage/efl/WebPageEfl.cpp:
 59 (WebKit::targetFrameForEditing): Referenced from QT port to get focused frame.
 60 (WebKit::WebPage::confirmComposition): Added to support composition.
 61 (WebKit::WebPage::setComposition): Ditto.
 62 (WebKit::WebPage::cancelComposition): Ditto.
 63
1642012-10-09 Sheriff Bot <webkit.review.bot@gmail.com>
265
366 Unreviewed, rolling out r130811 and r130821.

Source/WebKit2/PlatformEfl.cmake

@@LIST (APPEND WebProcess_SOURCES
200200
201201LIST (APPEND WebProcess_LIBRARIES
202202 ${CAIRO_LIBRARIES}
 203 ${ECORE_IMF_LIBRARIES}
203204 ${ECORE_X_LIBRARIES}
204205 ${EDJE_LIBRARIES}
205206 ${EFLDEPS_LIBRARIES}

Source/WebKit2/Shared/NativeWebKeyboardEvent.h

@@public:
5656 NativeWebKeyboardEvent(const NativeWebKeyboardEvent&);
5757 NativeWebKeyboardEvent(GdkEvent*);
5858#elif PLATFORM(EFL)
59  NativeWebKeyboardEvent(const Evas_Event_Key_Down*);
 59 NativeWebKeyboardEvent(const Evas_Event_Key_Down*, bool);
6060 NativeWebKeyboardEvent(const Evas_Event_Key_Up*);
6161#endif
6262

@@public:
7070 GdkEvent* nativeEvent() const { return m_nativeEvent.get(); }
7171#elif PLATFORM(EFL)
7272 const void* nativeEvent() const { return m_nativeEvent; }
 73 bool isFiltered() const { return m_isFiltered; }
7374#endif
7475
7576private:

@@private:
8384 GOwnPtr<GdkEvent> m_nativeEvent;
8485#elif PLATFORM(EFL)
8586 const void* m_nativeEvent;
 87 bool m_isFiltered;
8688#endif
8789};
8890

Source/WebKit2/Shared/efl/NativeWebKeyboardEventEfl.cpp

3030
3131namespace WebKit {
3232
33 NativeWebKeyboardEvent::NativeWebKeyboardEvent(const Evas_Event_Key_Down* event)
 33NativeWebKeyboardEvent::NativeWebKeyboardEvent(const Evas_Event_Key_Down* event, bool isFiltered)
3434 : WebKeyboardEvent(WebEventFactory::createWebKeyboardEvent(event))
3535 , m_nativeEvent(event)
 36 , m_isFiltered(isFiltered)
3637{
3738}
3839
3940NativeWebKeyboardEvent::NativeWebKeyboardEvent(const Evas_Event_Key_Up* event)
4041 : WebKeyboardEvent(WebEventFactory::createWebKeyboardEvent(event))
4142 , m_nativeEvent(event)
 43 , m_isFiltered(false)
4244{
4345}
4446

Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp

@@void PageClientImpl::countStringMatchesInCustomRepresentation(const String&, Fin
281281 notImplemented();
282282}
283283
 284void PageClientImpl::updateTextInputState()
 285{
 286 ewk_view_text_input_state_update(m_viewWidget);
 287}
 288
284289void PageClientImpl::handleDownloadRequest(DownloadProxy* download)
285290{
286291 Ewk_Download_Job* ewkDownload = ewk_download_job_new(download, m_viewWidget);

Source/WebKit2/UIProcess/API/efl/PageClientImpl.h

@@private:
7676 virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&);
7777 virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&);
7878
 79 void updateTextInputState();
7980 virtual void handleDownloadRequest(DownloadProxy*);
8081
8182 virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool);

Source/WebKit2/UIProcess/API/efl/ewk_main.cpp

2525#include "ewk_private.h"
2626#include <Ecore.h>
2727#include <Ecore_Evas.h>
 28#include <Ecore_IMF.h>
2829#include <Edje.h>
2930#include <Eina.h>
3031#include <Evas.h>

@@int ewk_init(void)
7273 goto error_ecore_evas;
7374 }
7475
 76 if (!ecore_imf_init()) {
 77 CRITICAL("could not init ecore_imf.");
 78 goto error_ecore_imf;
 79 }
 80
7581#ifdef HAVE_ECORE_X
7682 if (!ecore_x_init(0)) {
7783 CRITICAL("could not init ecore_x.");

@@int ewk_init(void)
9096
9197#ifdef HAVE_ECORE_X
9298error_ecore_x:
93  ecore_evas_shutdown();
 99 ecore_imf_shutdown();
94100#endif
 101error_ecore_imf:
 102 ecore_evas_shutdown();
95103error_ecore_evas:
96104 ecore_shutdown();
97105error_ecore:

@@int ewk_shutdown(void)
113121#ifdef HAVE_ECORE_X
114122 ecore_x_shutdown();
115123#endif
 124 ecore_imf_shutdown();
116125 ecore_evas_shutdown();
117126 ecore_shutdown();
118127 evas_shutdown();

Source/WebKit2/UIProcess/API/efl/ewk_view.cpp

5454#include "ewk_view_resource_load_client_private.h"
5555#include "ewk_view_ui_client_private.h"
5656#include <Ecore_Evas.h>
 57#include <Ecore_IMF.h>
 58#include <Ecore_IMF_Evas.h>
5759#include <Edje.h>
5860#include <WebCore/Cursor.h>
 61#include <WebCore/Editor.h>
5962#include <WebCore/EflScreenUtilities.h>
6063#include <WebKit2/WKPageGroup.h>
6164#include <wtf/text/CString.h>

@@static const int defaultCursorSize = 16;
8184
8285typedef HashMap<uint64_t, Ewk_Resource*> LoadingResourcesMap;
8386static void _ewk_view_priv_loading_resources_clear(LoadingResourcesMap& loadingResourcesMap);
 87static Ecore_IMF_Context* _ewk_view_imf_context_create(Ewk_View_Smart_Data* smartData);
 88static void _ewk_view_imf_context_destroy(Ecore_IMF_Context* imfContext);
8489
8590struct _Ewk_View_Private_Data {
8691 OwnPtr<PageClientImpl> pageClient;

@@struct _Ewk_View_Private_Data {
108113 WebPopupMenuProxyEfl* popupMenuProxy;
109114 Eina_List* popupMenuItems;
110115
 116 Ecore_IMF_Context* imfContext;
 117 bool isImfFocused;
 118
111119#ifdef HAVE_ECORE_X
112120 bool isUsingEcoreX;
113121#endif

@@struct _Ewk_View_Private_Data {
129137#endif
130138 , popupMenuProxy(0)
131139 , popupMenuItems(0)
 140 , imfContext(0)
 141 , isImfFocused(false)
132142#ifdef HAVE_ECORE_X
133143 , isUsingEcoreX(false)
134144#endif

@@struct _Ewk_View_Private_Data {
142152 ~_Ewk_View_Private_Data()
143153 {
144154 _ewk_view_priv_loading_resources_clear(loadingResourcesMap);
 155 _ewk_view_imf_context_destroy(imfContext);
145156
146157 if (cursorObject)
147158 evas_object_del(cursorObject);

@@static Eina_Bool _ewk_view_smart_mouse_up(Ewk_View_Smart_Data* smartData, const
263274
264275 Evas_Point position = {smartData->view.x, smartData->view.y};
265276 priv->pageProxy->handleMouseEvent(NativeWebMouseEvent(upEvent, &position));
 277
 278 if (priv->imfContext)
 279 ecore_imf_context_reset(priv->imfContext);
 280
266281 return true;
267282}
268283

@@static Eina_Bool _ewk_view_smart_key_down(Ewk_View_Smart_Data* smartData, const
279294{
280295 EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
281296
282  priv->pageProxy->handleKeyboardEvent(NativeWebKeyboardEvent(downEvent));
 297 bool isFiltered = false;
 298 if (priv->imfContext) {
 299 Ecore_IMF_Event imfEvent;
 300 ecore_imf_evas_event_key_down_wrap(const_cast<Evas_Event_Key_Down*>(downEvent), &imfEvent.key_down);
 301
 302 isFiltered = ecore_imf_context_filter_event(priv->imfContext, ECORE_IMF_EVENT_KEY_DOWN, &imfEvent);
 303 }
 304
 305 priv->pageProxy->handleKeyboardEvent(NativeWebKeyboardEvent(downEvent, isFiltered));
283306 return true;
284307}
285308

@@static void _ewk_view_on_touch_move(void* /* data */, Evas* /* canvas */, Evas_O
421444}
422445#endif
423446
 447static void _ewk_view_preedit_changed(void* data, Ecore_IMF_Context* context, void*)
 448{
 449 Ewk_View_Smart_Data* smartData = static_cast<Ewk_View_Smart_Data*>(data);
 450 EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
 451
 452 if (!priv->pageProxy->focusedFrame() || !priv->isImfFocused)
 453 return;
 454
 455 char* buffer = 0;
 456 ecore_imf_context_preedit_string_get(context, &buffer, 0);
 457 if (!buffer)
 458 return;
 459
 460 String preeditString = String::fromUTF8(buffer);
 461 Vector<CompositionUnderline> underlines;
 462 underlines.append(CompositionUnderline(0, preeditString.length(), Color(0, 0, 0), false));
 463 priv->pageProxy->setComposition(preeditString, underlines, 0);
 464}
 465
 466static void _ewk_view_commit(void* data, Ecore_IMF_Context*, void* eventInfo)
 467{
 468 Ewk_View_Smart_Data* smartData = static_cast<Ewk_View_Smart_Data*>(data);
 469 EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
 470 if (!eventInfo || !priv->isImfFocused)
 471 return;
 472
 473 priv->pageProxy->confirmComposition(String::fromUTF8(static_cast<char*>(eventInfo)));
 474}
 475
424476static Evas_Smart_Class g_parentSmartClass = EVAS_SMART_CLASS_INIT_NULL;
425477
426478static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* smartData)

@@static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* smartData)
431483 return 0;
432484 }
433485
 486 priv->imfContext = _ewk_view_imf_context_create(smartData);
 487
434488#ifdef HAVE_ECORE_X
435489 priv->isUsingEcoreX = WebCore::isUsingEcoreX(smartData->base.evas);
436490#endif

@@void ewk_view_text_found(Evas_Object* ewkView, unsigned int matchCount)
10791133 evas_object_smart_callback_call(ewkView, "text,found", &matchCount);
10801134}
10811135
 1136static Ecore_IMF_Context* _ewk_view_imf_context_create(Ewk_View_Smart_Data* smartData)
 1137{
 1138 const char* defaultContextID = ecore_imf_context_default_id_get();
 1139 if (!defaultContextID)
 1140 return 0;
 1141
 1142 Ecore_IMF_Context* imfContext = ecore_imf_context_add(defaultContextID);
 1143 if (!imfContext)
 1144 return 0;
 1145
 1146 ecore_imf_context_event_callback_add(imfContext, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, _ewk_view_preedit_changed, smartData);
 1147 ecore_imf_context_event_callback_add(imfContext, ECORE_IMF_CALLBACK_COMMIT, _ewk_view_commit, smartData);
 1148
 1149 Ecore_Evas* ecoreEvas = ecore_evas_ecore_evas_get(smartData->base.evas);
 1150 ecore_imf_context_client_window_set(imfContext, (void*)ecore_evas_window_get(ecoreEvas));
 1151 ecore_imf_context_client_canvas_set(imfContext, smartData->base.evas);
 1152
 1153 return imfContext;
 1154}
 1155
 1156static void _ewk_view_imf_context_destroy(Ecore_IMF_Context* imfContext)
 1157{
 1158 if (!imfContext)
 1159 return;
 1160
 1161 ecore_imf_context_event_callback_del(imfContext, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, _ewk_view_preedit_changed);
 1162 ecore_imf_context_event_callback_del(imfContext, ECORE_IMF_CALLBACK_COMMIT, _ewk_view_commit);
 1163 ecore_imf_context_del(imfContext);
 1164}
 1165
 1166/**
 1167 * @internal
 1168 * The view was requested to update text input state
 1169 */
 1170void ewk_view_text_input_state_update(Evas_Object* ewkView)
 1171{
 1172 EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
 1173 EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
 1174
 1175 if (!priv->imfContext)
 1176 return;
 1177
 1178 const EditorState& editor = priv->pageProxy->editorState();
 1179
 1180 if (editor.isContentEditable) {
 1181 if (priv->isImfFocused)
 1182 return;
 1183
 1184 ecore_imf_context_reset(priv->imfContext);
 1185 ecore_imf_context_focus_in(priv->imfContext);
 1186 priv->isImfFocused = true;
 1187 } else {
 1188 if (!priv->isImfFocused)
 1189 return;
 1190
 1191 if (editor.hasComposition)
 1192 priv->pageProxy->cancelComposition();
 1193
 1194 priv->isImfFocused = false;
 1195 ecore_imf_context_reset(priv->imfContext);
 1196 ecore_imf_context_focus_out(priv->imfContext);
 1197 }
 1198}
 1199
10821200/**
10831201 * @internal
10841202 * The view title was changed by the frame loader.

Source/WebKit2/UIProcess/API/efl/ewk_view_private.h

@@void ewk_view_resource_load_initiated(Evas_Object* ewkView, uint64_t resourceIde
8282void ewk_view_resource_load_response(Evas_Object* ewkView, uint64_t resourceIdentifier, Ewk_Url_Response* response);
8383void ewk_view_resource_request_sent(Evas_Object* ewkView, uint64_t resourceIdentifier, Ewk_Url_Request* request, Ewk_Url_Response* redirectResponse);
8484void ewk_view_text_found(Evas_Object* ewkView, unsigned int matchCount);
 85void ewk_view_text_input_state_update(Evas_Object* ewkView);
8586void ewk_view_url_update(Evas_Object* ewkView);
8687void ewk_view_contents_size_changed(const Evas_Object* ewkView, const WebCore::IntSize&);
8788

Source/WebKit2/UIProcess/PageClient.h

@@public:
122122 virtual void pageTransitionViewportReady() = 0;
123123 virtual void didFindZoomableArea(const WebCore::IntPoint&, const WebCore::IntRect&) = 0;
124124 virtual void didReceiveMessageFromNavigatorQtObject(const String&) = 0;
125  virtual void updateTextInputState() = 0;
126125 virtual void handleAuthenticationRequiredRequest(const String& hostname, const String& realm, const String& prefilledUsername, String& username, String& password) = 0;
127126 virtual void handleCertificateVerificationRequest(const String& hostname, bool& ignoreErrors) = 0;
128127 virtual void handleProxyAuthenticationRequiredRequest(const String& hostname, uint16_t port, const String& prefilledUsername, String& username, String& password) = 0;
129128#endif // PLATFORM(QT).
130129
131130#if PLATFORM(QT) || PLATFORM(EFL)
 131 virtual void updateTextInputState() = 0;
132132 virtual void handleDownloadRequest(DownloadProxy*) = 0;
133133#endif // PLATFORM(QT) || PLATFORM(EFL)
134134

Source/WebKit2/UIProcess/WebPageProxy.cpp

@@void WebPageProxy::editorStateChanged(const EditorState& editorState)
28932893
28942894#if PLATFORM(MAC)
28952895 m_pageClient->updateTextInputState(couldChangeSecureInputState);
2896 #elif PLATFORM(QT)
 2896#elif PLATFORM(QT) || PLATFORM(EFL)
28972897 m_pageClient->updateTextInputState();
28982898#endif
28992899}

Source/WebKit2/UIProcess/WebPageProxy.h

@@public:
414414
415415 HWND nativeWindow() const;
416416#endif
 417#if PLATFORM(EFL)
 418 void handleInputMethodKeydown(bool& handled);
 419 void confirmComposition(const String&);
 420 void setComposition(const String&, Vector<WebCore::CompositionUnderline>&, int);
 421 void cancelComposition();
 422#endif
417423#if USE(CAIRO) && !PLATFORM(WIN_CAIRO)
418424 PlatformWidget viewWidget();
419425#endif

Source/WebKit2/UIProcess/WebPageProxy.messages.in

@@messages -> WebPageProxy {
6969 DidBlockInsecurePluginVersion(WTF::String mimeType, WTF::String urlString)
7070 SetCanShortCircuitHorizontalWheelEvents(bool canShortCircuitHorizontalWheelEvents)
7171
 72#if PLATFORM(EFL)
 73 HandleInputMethodKeydown() -> (bool handled)
 74#endif
 75
7276#if USE(TILED_BACKING_STORE)
7377 PageDidRequestScroll(WebCore::IntPoint point)
7478#endif

Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp

2626#include "config.h"
2727#include "WebPageProxy.h"
2828
 29#include "NativeWebKeyboardEvent.h"
2930#include "NotImplemented.h"
3031#include "PageClientImpl.h"
3132#include "WebKitVersion.h"

@@void WebPageProxy::windowedPluginGeometryDidChange(const WebCore::IntRect&, cons
9394 notImplemented();
9495}
9596
 97void WebPageProxy::handleInputMethodKeydown(bool& handled)
 98{
 99 handled = m_keyEventQueue.first().isFiltered();
 100}
 101
 102void WebPageProxy::confirmComposition(const String& compositionString)
 103{
 104 if (!isValid())
 105 return;
 106
 107 process()->send(Messages::WebPage::ConfirmComposition(compositionString), m_pageID, 0);
 108}
 109
 110void WebPageProxy::setComposition(const String& compositionString, Vector<WebCore::CompositionUnderline>& underlines, int cursorPosition)
 111{
 112 if (!isValid())
 113 return;
 114
 115 process()->send(Messages::WebPage::SetComposition(compositionString, underlines, cursorPosition), m_pageID, 0);
 116}
 117
 118void WebPageProxy::cancelComposition()
 119{
 120 if (!isValid())
 121 return;
 122
 123 process()->send(Messages::WebPage::CancelComposition(), m_pageID, 0);
 124}
 125
96126} // namespace WebKit

Source/WebKit2/WebProcess/WebCoreSupport/efl/WebEditorClientEfl.cpp

2727#include "WebEditorClient.h"
2828
2929#include "Frame.h"
 30#include "NativeWebKeyboardEvent.h"
3031#include "PlatformKeyboardEvent.h"
3132#include "WebPage.h"
3233#include "WebPageProxyMessages.h"
3334#include "WebProcess.h"
 35#include <WebCore/FocusController.h>
3436#include <WebCore/KeyboardEvent.h>
3537#include <WebCore/NotImplemented.h>
 38#include <WebCore/Page.h>
3639
3740using namespace WebCore;
3841

@@void WebEditorClient::handleKeyboardEvent(KeyboardEvent* event)
4447 event->setDefaultHandled();
4548}
4649
47 void WebEditorClient::handleInputMethodKeydown(KeyboardEvent*)
 50void WebEditorClient::handleInputMethodKeydown(KeyboardEvent* event)
4851{
49  notImplemented();
 52 Frame* frame = m_page->corePage()->focusController()->focusedOrMainFrame();
 53 if (!frame || !frame->editor()->canEdit())
 54 return;
 55
 56 // FIXME: sending sync message might make input lagging.
 57 bool handled = false;
 58 m_page->sendSync(Messages::WebPageProxy::HandleInputMethodKeydown(), Messages::WebPageProxy::HandleInputMethodKeydown::Reply(handled));
 59
 60 if (handled)
 61 event->setDefaultHandled();
5062}
5163
5264}

Source/WebKit2/WebProcess/WebPage/WebPage.h

@@public:
460460 void gestureWillBegin(const WebCore::IntPoint&, bool& canBeginPanning);
461461 void gestureDidScroll(const WebCore::IntSize&);
462462 void gestureDidEnd();
463 
 463#elif PLATFORM(EFL)
 464 void confirmComposition(const String& compositionString);
 465 void setComposition(const WTF::String& compositionString, const WTF::Vector<WebCore::CompositionUnderline>& underlines, uint64_t cursorPosition);
 466 void cancelComposition();
464467#elif PLATFORM(GTK)
465468 void updateAccessibilityTree();
466469#if USE(TEXTURE_MAPPER_GL)

Source/WebKit2/WebProcess/WebPage/WebPage.messages.in

@@messages -> WebPage {
290290 GestureDidScroll(WebCore::IntSize size)
291291 GestureDidEnd()
292292#endif
 293#if PLATFORM(EFL)
 294 ConfirmComposition(WTF::String compositionString)
 295 SetComposition(WTF::String compositionString, WTF::Vector<WebCore::CompositionUnderline> underlines, uint64_t cursorPosition)
 296 CancelComposition()
 297#endif
293298#if PLATFORM(QT)
294299 FindZoomableAreaForPoint(WebCore::IntPoint point, WebCore::IntSize area)
295300#endif

Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp

2828#include "config.h"
2929#include "WebPage.h"
3030
 31#include "EditorState.h"
3132#include "NotImplemented.h"
3233#include "WebEvent.h"
3334#include "WindowsKeyboardCodes.h"

@@void WebPage::setThemePath(const String& themePath)
152153 theme->setThemePath(themePath);
153154}
154155
 156static Frame* targetFrameForEditing(WebPage* page)
 157{
 158 Frame* frame = page->corePage()->focusController()->focusedOrMainFrame();
 159 if (!frame)
 160 return 0;
 161
 162 Editor* editor = frame->editor();
 163 if (!editor->canEdit())
 164 return 0;
 165
 166 if (editor->hasComposition()) {
 167 // We should verify the parent node of this IME composition node are
 168 // editable because JavaScript may delete a parent node of the composition
 169 // node. In this case, WebKit crashes while deleting texts from the parent
 170 // node, which doesn't exist any longer.
 171 if (PassRefPtr<Range> range = editor->compositionRange()) {
 172 Node* node = range->startContainer();
 173 if (!node || !node->isContentEditable())
 174 return 0;
 175 }
 176 }
 177
 178 return frame;
 179}
 180
 181void WebPage::confirmComposition(const String& compositionString)
 182{
 183 Frame* targetFrame = targetFrameForEditing(this);
 184 if (!targetFrame)
 185 return;
 186
 187 targetFrame->editor()->confirmComposition(compositionString);
 188}
 189
 190void WebPage::setComposition(const String& compositionString, const Vector<WebCore::CompositionUnderline>& underlines, uint64_t cursorPosition)
 191{
 192 Frame* targetFrame = targetFrameForEditing(this);
 193 if (!targetFrame)
 194 return;
 195
 196 targetFrame->editor()->setComposition(compositionString, underlines, cursorPosition, 0);
 197}
 198
 199void WebPage::cancelComposition()
 200{
 201 Frame* frame = m_page->focusController()->focusedOrMainFrame();
 202 if (!frame)
 203 return;
 204
 205 frame->editor()->cancelComposition();
 206}
 207
155208} // namespace WebKit

Source/cmake/FindEcore.cmake

@@FIND_EFL_LIBRARY(ECORE_X
6767 HEADER_PREFIXES ecore-1
6868 LIBRARY ecore_x
6969)
 70FIND_EFL_LIBRARY(ECORE_IMF
 71 HEADERS Ecore_IMF.h Ecore_IMF_Evas.h
 72 HEADER_PREFIXES ecore-1
 73 LIBRARY ecore_imf
 74)
7075
7176FOREACH(_component ${Ecore_FIND_COMPONENTS})
7277 SET(_ecore_component "ECORE_${_component}")

ChangeLog

 12012-10-09 Ryuan Choi <ryuan.choi@samsung.com>
 2
 3 [EFL][WK2] Add support for IMF composition
 4 https://bugs.webkit.org/show_bug.cgi?id=89552
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * Source/cmake/FindEcore.cmake: Checked Ecore_IMF.
 9
1102012-10-09 Simon Pena <spena@igalia.com>
211
312 [GTK] Add support for running JavaScript from GResources