Block UI events not to be sent to the WebProcess while js popup is displayed.
authorByungwoo Lee <bw80.lee@samsung.com>
Wed, 5 Sep 2012 15:05:48 +0000 (00:05 +0900)
committerByungwoo Lee <bw80.lee@samsung.com>
Wed, 5 Sep 2012 15:05:48 +0000 (00:05 +0900)
[Title] Block UI events not to be sent to the WebProcess while js popup is displayed.
[Issue#] N_SE-8944 / N_SE-8828 / N_SE-8867 / N_SE-8935 / N_SE-8935 (tizendev.org/bugs)
[Problem] UI Process is terminated when js popup is displayed.
[Cause] Not permitted IPC messages about user event (touch, mouse, guesture, keyboard)
        can be sent to the WebProcess while js popup is displayed
[Solution] Add blocking code for the events while js popup is displayed.
[Developer] bw80.lee

Change-Id: Ic1753b244557d4e3ae9353e0707616860538a30f

Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp

index cf97a3a..71e670c 100755 (executable)
@@ -270,6 +270,10 @@ struct _Ewk_View_Private_Data {
         void* data;
     } orientationLock;
 #endif
+
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    bool isJavaScriptPopupStarted;
+#endif
 #endif // #if OS(TIZEN)
 };
 
@@ -452,6 +456,11 @@ static Eina_Bool _ewk_view_smart_mouse_wheel(Ewk_View_Smart_Data* smartData, con
 {
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false)
 
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    if (priv->isJavaScriptPopupStarted)
+        return false;
+#endif
+
     Evas_Point position = {smartData->view.x, smartData->view.y};
     priv->pageClient->page()->handleWheelEvent(NativeWebWheelEvent(wheelEvent, &position));
     return true;
@@ -463,6 +472,11 @@ void ewkViewHandleTouchEvent(Evas_Object* ewkView, Ewk_Touch_Event_Type type)
     Ewk_View_Smart_Data* smartData = static_cast<Ewk_View_Smart_Data*>(evas_object_smart_data_get(ewkView));
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv)
 
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    if (priv->isJavaScriptPopupStarted)
+        return;
+#endif
+
     Eina_List* points = 0;
     int count = evas_touch_point_list_count(smartData->base.evas);
     Ewk_Touch_Point* point;
@@ -486,6 +500,11 @@ static Eina_Bool _ewk_view_touch_animator(void *data)
     Ewk_View_Smart_Data* smartData = static_cast<Ewk_View_Smart_Data*>(data);
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false)
 
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    if (priv->isJavaScriptPopupStarted)
+        return false;
+#endif
+
     if (!priv->exceedTouchMoveThreshold && evas_touch_point_list_count(smartData->base.evas)) {
         Evas_Coord x, y;
         evas_touch_point_list_nth_xy_get(smartData->base.evas, 0, &x, &y);
@@ -506,6 +525,11 @@ static Eina_Bool _ewk_view_smart_mouse_down(Ewk_View_Smart_Data* smartData, cons
 {
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false)
 
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    if (priv->isJavaScriptPopupStarted)
+        return false;
+#endif
+
     Evas_Point position = {smartData->view.x, smartData->view.y};
     priv->pageClient->page()->handleMouseEvent(NativeWebMouseEvent(downEvent, &position));
     return true;
@@ -515,6 +539,11 @@ static Eina_Bool _ewk_view_smart_mouse_up(Ewk_View_Smart_Data* smartData, const
 {
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false)
 
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    if (priv->isJavaScriptPopupStarted)
+        return false;
+#endif
+
     Evas_Point position = {smartData->view.x, smartData->view.y};
     priv->pageClient->page()->handleMouseEvent(NativeWebMouseEvent(upEvent, &position));
     return true;
@@ -524,6 +553,11 @@ static Eina_Bool _ewk_view_smart_mouse_move(Ewk_View_Smart_Data* smartData, cons
 {
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false)
 
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    if (priv->isJavaScriptPopupStarted)
+        return false;
+#endif
+
     Evas_Point position = {smartData->view.x, smartData->view.y};
     priv->pageClient->page()->handleMouseEvent(NativeWebMouseEvent(moveEvent, &position));
     return true;
@@ -533,6 +567,11 @@ static Eina_Bool _ewk_view_smart_key_down(Ewk_View_Smart_Data* smartData, const
 {
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false)
 
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    if (priv->isJavaScriptPopupStarted)
+        return false;
+#endif
+
 #if ENABLE(TIZEN_ISF_PORT)
     Ecore_IMF_Event IMFEvent;
     ecore_imf_evas_event_key_down_wrap(const_cast<Evas_Event_Key_Down*>(downEvent), &IMFEvent.key_down);
@@ -550,6 +589,11 @@ static Eina_Bool _ewk_view_smart_key_up(Ewk_View_Smart_Data* smartData, const Ev
 {
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false)
 
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    if (priv->isJavaScriptPopupStarted)
+        return false;
+#endif
+
     priv->pageClient->page()->handleKeyboardEvent(NativeWebKeyboardEvent(upEvent));
     return true;
 }
@@ -588,6 +632,11 @@ static Eina_Bool _ewk_view_smart_gesture_start(Ewk_View_Smart_Data* smartData, c
 {
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false)
 
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    if (priv->isJavaScriptPopupStarted)
+        return false;
+#endif
+
     switch (event->type) {
     case EWK_GESTURE_TAP:
         priv->gestureClient->startTap(IntPoint(event->position.x, event->position.y));
@@ -619,6 +668,11 @@ static Eina_Bool _ewk_view_smart_gesture_end(Ewk_View_Smart_Data* smartData, con
 {
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false)
 
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    if (priv->isJavaScriptPopupStarted)
+        return false;
+#endif
+
     switch (event->type) {
     case EWK_GESTURE_TAP:
         if (event->count == 1)
@@ -650,6 +704,11 @@ static Eina_Bool _ewk_view_smart_gesture_move(Ewk_View_Smart_Data* smartData, co
 {
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false)
 
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    if (priv->isJavaScriptPopupStarted)
+        return false;
+#endif
+
     switch (event->type) {
     case EWK_GESTURE_PAN:
         priv->gestureClient->movePan(IntPoint(event->position.x, event->position.y));
@@ -760,6 +819,13 @@ static void _ewk_view_on_mouse_wheel(void* data, Evas* canvas, Evas_Object* ewkV
     Ewk_View_Smart_Data* smartData = static_cast<Ewk_View_Smart_Data*>(data);
     EINA_SAFETY_ON_NULL_RETURN(smartData->api);
     EINA_SAFETY_ON_NULL_RETURN(smartData->api->mouse_wheel);
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv)
+
+    if (priv->isJavaScriptPopupStarted)
+        return;
+#endif
+
     smartData->api->mouse_wheel(smartData, wheelEvent);
 }
 
@@ -769,6 +835,13 @@ static void _ewk_view_on_mouse_down(void* data, Evas* canvas, Evas_Object* ewkVi
     Ewk_View_Smart_Data* smartData = static_cast<Ewk_View_Smart_Data*>(data);
     EINA_SAFETY_ON_NULL_RETURN(smartData->api);
     EINA_SAFETY_ON_NULL_RETURN(smartData->api->mouse_down);
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv)
+
+    if (priv->isJavaScriptPopupStarted)
+        return;
+#endif
+
     smartData->api->mouse_down(smartData, downEvent);
 }
 
@@ -778,6 +851,13 @@ static void _ewk_view_on_mouse_up(void* data, Evas* canvas, Evas_Object* ewkView
     Evas_Event_Mouse_Up* upEvent = static_cast<Evas_Event_Mouse_Up*>(eventInfo);
     EINA_SAFETY_ON_NULL_RETURN(smartData->api);
     EINA_SAFETY_ON_NULL_RETURN(smartData->api->mouse_up);
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv)
+
+    if (priv->isJavaScriptPopupStarted)
+        return;
+#endif
+
     smartData->api->mouse_up(smartData, upEvent);
 }
 
@@ -787,6 +867,13 @@ static void _ewk_view_on_mouse_move(void* data, Evas* canvas, Evas_Object* ewkVi
     Ewk_View_Smart_Data* smartData = static_cast<Ewk_View_Smart_Data*>(data);
     EINA_SAFETY_ON_NULL_RETURN(smartData->api);
     EINA_SAFETY_ON_NULL_RETURN(smartData->api->mouse_move);
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv)
+
+    if (priv->isJavaScriptPopupStarted)
+        return;
+#endif
+
     smartData->api->mouse_move(smartData, moveEvent);
 }
 
@@ -797,6 +884,13 @@ static void _ewk_view_on_key_down(void* data, Evas* canvas, Evas_Object* ewkView
 
     EINA_SAFETY_ON_NULL_RETURN(smartData->api);
     EINA_SAFETY_ON_NULL_RETURN(smartData->api->key_down);
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv)
+
+    if (priv->isJavaScriptPopupStarted)
+        return;
+#endif
+
     smartData->api->key_down(smartData, downEvent);
 }
 
@@ -806,6 +900,13 @@ static void _ewk_view_on_key_up(void* data, Evas* canvas, Evas_Object* ewkView,
     Ewk_View_Smart_Data* smartData = static_cast<Ewk_View_Smart_Data*>(data);
     EINA_SAFETY_ON_NULL_RETURN(smartData->api);
     EINA_SAFETY_ON_NULL_RETURN(smartData->api->key_up);
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv)
+
+    if (priv->isJavaScriptPopupStarted)
+        return;
+#endif
+
     smartData->api->key_up(smartData, upEvent);
 }
 
@@ -840,6 +941,11 @@ static void _ewk_view_on_touch_down(void* data, Evas* canvas, Evas_Object* ewkVi
     EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
 
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    if (priv->isJavaScriptPopupStarted)
+        return;
+#endif
+
     // Start touchAnimator if current number of touch is one.
     if (evas_touch_point_list_count(smartData->base.evas) == 1) {
         priv->gestureRecognizer->initializeGesture();
@@ -859,6 +965,11 @@ static void _ewk_view_on_touch_up(void* data, Evas* canvas, Evas_Object* ewkView
     EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
 
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    if (priv->isJavaScriptPopupStarted)
+        return;
+#endif
+
     // Stop touchAnimator if current number of touch is one.
     if (evas_touch_point_list_count(smartData->base.evas) == 1 && priv->touchAnimator) {
         ecore_animator_del(priv->touchAnimator);
@@ -878,6 +989,11 @@ Eina_Bool _ewk_view_text_selection_down(Ewk_View_Smart_Data* smartData, int x, i
 {
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
 
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    if (priv->isJavaScriptPopupStarted)
+        return false;
+#endif
+
     IntPoint point(x, y);
     priv->pageClient->textSelectionDown(point, true);
 
@@ -888,6 +1004,11 @@ Eina_Bool _ewk_view_text_selection_move(Ewk_View_Smart_Data* smartData, int x, i
 {
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
 
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    if (priv->isJavaScriptPopupStarted)
+        return false;
+#endif
+
     IntPoint point(x, y);
     priv->pageClient->textSelectionMove(point, true);
 
@@ -898,6 +1019,11 @@ Eina_Bool _ewk_view_text_selection_up(Ewk_View_Smart_Data* smartData, int x, int
 {
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
 
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    if (priv->isJavaScriptPopupStarted)
+        return false;
+#endif
+
     IntPoint point(x, y);
     priv->pageClient->textSelectionUp(point);
 
@@ -955,6 +1081,10 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* smartData)
 #if ENABLE(TIZEN_DATALIST_ELEMENT)
     priv->dataList = 0;
 #endif
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    priv->isJavaScriptPopupStarted = false;
+#endif
+
 
 #endif // #if OS(TIZEN)
 
@@ -2923,12 +3053,24 @@ bool ewkViewRunJavaScriptAlert(Evas_Object* ewkView, WKStringRef alertText)
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
     if (!priv->alertContext || !priv->alertContext->javascriptAlertCallback)
         return false;
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    if (priv->isJavaScriptPopupStarted)
+        return false;
+#endif
     EINA_SAFETY_ON_FALSE_RETURN_VAL(priv->alertContext->ewkView == ewkView, false);
 
     int length = WKStringGetMaximumUTF8CStringSize(alertText);
     OwnArrayPtr<char> alertTextBuffer = adoptArrayPtr(new char[length]);
     WKStringGetUTF8CString(alertText, alertTextBuffer.get(), length);
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    if (priv->alertContext->javascriptAlertCallback(priv->alertContext->ewkView, alertTextBuffer.get(), priv->alertContext->userData) == EINA_FALSE)
+        return false;
+
+    priv->isJavaScriptPopupStarted = true;
+    return true;
+#else
     return priv->alertContext->javascriptAlertCallback(priv->alertContext->ewkView, alertTextBuffer.get(), priv->alertContext->userData) == EINA_TRUE;
+#endif
 }
 
 bool ewkViewRunJavaScriptConfirm(Evas_Object* ewkView, WKStringRef message)
@@ -2937,12 +3079,24 @@ bool ewkViewRunJavaScriptConfirm(Evas_Object* ewkView, WKStringRef message)
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
     if (!priv->confirmContext || !priv->confirmContext->javascriptConfirmCallback)
         return false;
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    if (priv->isJavaScriptPopupStarted)
+        return false;
+#endif
     EINA_SAFETY_ON_FALSE_RETURN_VAL(priv->confirmContext->ewkView == ewkView, false);
 
     int length = WKStringGetMaximumUTF8CStringSize(message);
     OwnArrayPtr<char> messageBuffer = adoptArrayPtr(new char[length]);
     WKStringGetUTF8CString(message, messageBuffer.get(), length);
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    if (priv->confirmContext->javascriptConfirmCallback(priv->confirmContext->ewkView, messageBuffer.get(), priv->confirmContext->userData) == EINA_FALSE)
+        return false;
+
+    priv->isJavaScriptPopupStarted = true;
+    return true;
+#else
     return priv->confirmContext->javascriptConfirmCallback(priv->confirmContext->ewkView, messageBuffer.get(), priv->confirmContext->userData) == EINA_TRUE;
+#endif
 }
 
 bool ewkViewRunJavaScriptPrompt(Evas_Object* ewkView, WKStringRef message, WKStringRef defaultValue)
@@ -2951,6 +3105,10 @@ bool ewkViewRunJavaScriptPrompt(Evas_Object* ewkView, WKStringRef message, WKStr
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
     if (!priv->promptContext || !priv->promptContext->javascriptPromptCallback)
         return false;
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    if (priv->isJavaScriptPopupStarted)
+        return false;
+#endif
     EINA_SAFETY_ON_FALSE_RETURN_VAL(priv->promptContext->ewkView == ewkView, false);
 
     int length = WKStringGetMaximumUTF8CStringSize(message);
@@ -2959,7 +3117,15 @@ bool ewkViewRunJavaScriptPrompt(Evas_Object* ewkView, WKStringRef message, WKStr
     length = WKStringGetMaximumUTF8CStringSize(defaultValue);
     OwnArrayPtr<char> defaultValueBuffer = adoptArrayPtr(new char[length]);
     WKStringGetUTF8CString(defaultValue, defaultValueBuffer.get(), length);
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    if (priv->promptContext->javascriptPromptCallback(priv->promptContext->ewkView, messageBuffer.get(), defaultValueBuffer.get(), priv->promptContext->userData) == EINA_FALSE)
+        return false;
+
+    priv->isJavaScriptPopupStarted = true;
+    return true;
+#else
     return priv->promptContext->javascriptPromptCallback(priv->promptContext->ewkView, messageBuffer.get(), defaultValueBuffer.get(), priv->promptContext->userData) == EINA_TRUE;
+#endif
 }
 
 bool ewkViewRunOpenPanel(Evas_Object* ewkView, WKOpenPanelParametersRef parameters, WKOpenPanelResultListenerRef listener)
@@ -3021,6 +3187,10 @@ void ewk_view_javascript_alert_reply(Evas_Object* ewkView)
     EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
 
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    priv->isJavaScriptPopupStarted = false;
+#endif
+
     WKPageReplyJavaScriptAlert(toAPI(ewk_view_page_get(ewkView)));
 }
 
@@ -3041,6 +3211,10 @@ void ewk_view_javascript_confirm_reply(Evas_Object* ewkView, Eina_Bool result)
     EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
 
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    priv->isJavaScriptPopupStarted = false;
+#endif
+
     WKPageReplyJavaScriptConfirm(toAPI(ewk_view_page_get(ewkView)), result == EINA_TRUE);
 }
 
@@ -3061,6 +3235,10 @@ void ewk_view_javascript_prompt_reply(Evas_Object* ewkView, const char* result)
     EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
 
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    priv->isJavaScriptPopupStarted = false;
+#endif
+
     WKRetainPtr<WKStringRef> resultString(AdoptWK, WKStringCreateWithUTF8CString(result));
     WKPageReplyJavaScriptPrompt(toAPI(ewk_view_page_get(ewkView)), result ? resultString.get() : 0);
 }
index fd6b7fc..760d5dc 100755 (executable)
@@ -1012,6 +1012,11 @@ void WebPageProxy::handleMouseEvent(const NativeWebMouseEvent& event)
     if (!isValid())
         return;
 
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    if (isWaitingForJavaScriptPopupReply())
+        return;
+#endif
+
     // NOTE: This does not start the responsiveness timer because mouse move should not indicate interaction.
     if (event.type() != WebEvent::MouseMove)
         process()->responsivenessTimer()->start();
@@ -1120,6 +1125,11 @@ void WebPageProxy::handleWheelEvent(const NativeWebWheelEvent& event)
     if (!isValid())
         return;
 
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    if (isWaitingForJavaScriptPopupReply())
+        return;
+#endif
+
     if (!m_currentlyProcessedWheelEvents.isEmpty()) {
         m_wheelEventQueue.append(event);
         if (m_wheelEventQueue.size() < wheelEventQueueSizeThreshold)
@@ -1165,6 +1175,11 @@ void WebPageProxy::handleKeyboardEvent(const NativeWebKeyboardEvent& event)
     if (!isValid())
         return;
     
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    if (isWaitingForJavaScriptPopupReply())
+        return;
+#endif
+
     LOG(KeyHandling, "WebPageProxy::handleKeyboardEvent: %s", webKeyboardEventTypeString(event.type()));
 
     m_keyEventQueue.append(event);
index 700104a..839eccb 100755 (executable)
@@ -968,6 +968,9 @@ private:
     void showPage();
     void closePage(bool stopResponsivenessTimer);
 #if OS(TIZEN)
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+    bool isWaitingForJavaScriptPopupReply();
+#endif
     void runJavaScriptAlert(uint64_t frameID, const String&, PassRefPtr<Messages::WebPageProxy::RunJavaScriptAlert::DelayedReply>);
     void runJavaScriptConfirm(uint64_t frameID, const String&, PassRefPtr<Messages::WebPageProxy::RunJavaScriptConfirm::DelayedReply>);
     void runJavaScriptPrompt(uint64_t frameID, const String&, const String&, PassRefPtr<Messages::WebPageProxy::RunJavaScriptPrompt::DelayedReply>);
index 273bdb6..33e2b8a 100755 (executable)
@@ -748,6 +748,13 @@ void WebPageProxy::didGetTextStyleStateForSelection(int underlineState, int ital
 }
 #endif
 
+#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
+bool WebPageProxy::isWaitingForJavaScriptPopupReply()
+{
+    return m_alertReply || m_confirmReply || m_promptReply;
+}
+#endif
+
 #endif // #if OS(TIZEN)
 
 } // namespace WebKit