Fixed sometimes foucs ring disappear late and is not shown.
[framework/web/webkit-efl.git] / Source / WebKit2 / UIProcess / API / efl / ewk_view.cpp
index fcdcee1..1404830 100755 (executable)
@@ -261,6 +261,7 @@ static void _ewk_view_smart_changed(Ewk_View_Smart_Data* smartData)
     evas_object_smart_changed(smartData->self);
 }
 
+#if !ENABLE(TIZEN_ICON_DATABASE)
 static void _ewk_view_on_favicon_changed(const char* pageURL, void* eventInfo)
 {
     Evas_Object* ewkView = static_cast<Evas_Object*>(eventInfo);
@@ -273,6 +274,7 @@ static void _ewk_view_on_favicon_changed(const char* pageURL, void* eventInfo)
 
     impl->informIconChange();
 }
+#endif
 
 // Default Event Handling.
 static Eina_Bool _ewk_view_smart_focus_in(Ewk_View_Smart_Data* smartData)
@@ -411,13 +413,13 @@ static Eina_Bool _ewk_view_smart_gesture_start(Ewk_View_Smart_Data* smartData, c
             impl->focusRing->requestToShow(IntPoint(event->position.x, event->position.y));
         } else if (event->type == EWK_GESTURE_PAN) {
             if (impl->exceedTouchMoveThreshold)
-                impl->focusRing->hide();
+                impl->focusRing->requestToHide();
         } else {
             if (event->type != EWK_GESTURE_LONG_PRESS) {
 #if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2)
                 if (!impl->pageClient->isContextMenuVisible())
 #endif
-                    impl->focusRing->hide();
+                    impl->focusRing->requestToHide();
             }
         }
     }
@@ -441,10 +443,15 @@ static Eina_Bool _ewk_view_smart_gesture_start(Ewk_View_Smart_Data* smartData, c
         IntPoint scenePoint(event->position.x, event->position.y);
         IntPoint contentsPoint = impl->transformFromScene().mapPoint(scenePoint);
         WebHitTestResult::Data hitTestResultData = impl->pageProxy->hitTestResultAtPoint(contentsPoint);
+        if (!hitTestResultData.absoluteMediaURL.isEmpty())
+            break;
 #if ENABLE(TIZEN_DRAG_SUPPORT)
         // 1. Check to start dragging.
-        if (hitTestResultData.isDragSupport) {
+        if (hitTestResultData.isDragSupport && !hitTestResultData.isContentEditable) {
             impl->pageClient->setDragPoint(scenePoint);
+            if (impl->pageClient->isDragMode()) {
+                impl->pageClient->setDragMode(false);
+            }
 #if ENABLE(TIZEN_WEBKIT2_FOCUS_RING)
             if (impl->focusRing)
                 impl->focusRing->show(IntRect(), true);
@@ -454,9 +461,8 @@ static Eina_Bool _ewk_view_smart_gesture_start(Ewk_View_Smart_Data* smartData, c
         }
 #endif
         // 2. Check to show context menu.
-        if (!hitTestResultData.absoluteImageURL.isEmpty()
-            || !hitTestResultData.absoluteLinkURL.isEmpty()
-            || !hitTestResultData.absoluteMediaURL.isEmpty()) {
+        if ((!hitTestResultData.absoluteImageURL.isEmpty() || !hitTestResultData.absoluteLinkURL.isEmpty())
+            && !hitTestResultData.isContentEditable) {
 #if ENABLE(TIZEN_WEBKIT2_FOCUS_RING)
             if (impl->focusRing)
                 impl->focusRing->show(IntRect(), true);
@@ -518,9 +524,9 @@ static Eina_Bool _ewk_view_smart_gesture_end(Ewk_View_Smart_Data* smartData, con
 #if ENABLE(TIZEN_WEBKIT2_FOCUS_RING)
     if (impl->focusRing) {
 #if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2)
-        if (!impl->pageClient->isContextMenuVisible())
+        if (!impl->pageClient->isContextMenuVisible() || impl->pageClient->isTextSelectionMode())
 #endif
-            impl->focusRing->hide();
+            impl->focusRing->requestToHide();
     }
 #endif
 
@@ -535,18 +541,17 @@ static Eina_Bool _ewk_view_smart_gesture_end(Ewk_View_Smart_Data* smartData, con
             if (impl->pageClient->isTextSelectionMode())
                 impl->pageClient->setIsTextSelectionMode(false);
 #endif
-            impl->gestureClient->endTap(IntPoint(event->position.x, event->position.y));
+
 #if ENABLE(TIZEN_ISF_PORT)
-            evas_object_focus_set(smartData->self, true);
+            if (impl->inputMethodContext()->isIMEPostion(event->position.x, event->position.y))
+                return false;
 #endif
+
+            impl->gestureClient->endTap(IntPoint(event->position.x, event->position.y));
         } else if (event->count == 2)
             impl->gestureClient->endDoubleTap(IntPoint(event->position.x, event->position.y));
         break;
     case EWK_GESTURE_LONG_PRESS:
-#if ENABLE(TIZEN_DRAG_SUPPORT)
-        if (impl->pageClient->isDragMode())
-            impl->pageClient->setDragMode(false);
-#endif
         // Prcess endTap for LONG_PRESS gesture if text-selection and context menu did not work
         impl->gestureClient->endTap(IntPoint(event->position.x, event->position.y));
         break;
@@ -582,7 +587,7 @@ static Eina_Bool _ewk_view_smart_gesture_move(Ewk_View_Smart_Data* smartData, co
 
 #if ENABLE(TIZEN_WEBKIT2_FOCUS_RING)
     if (impl->focusRing && !(event->type == EWK_GESTURE_PAN && !impl->exceedTouchMoveThreshold))
-        impl->focusRing->hide();
+        impl->focusRing->requestToHide(true);
 #endif
 
     switch (event->type) {
@@ -672,12 +677,33 @@ static void _ewk_view_on_hide(void* data, Evas*, Evas_Object*, void* /*eventInfo
 }
 
 #if OS(TIZEN)
+
+#if ENABLE(TIZEN_FULLSCREEN_API)
+Eina_Bool _ewk_view_smart_fullscreen_enter(Ewk_View_Smart_Data* smartData)
+{
+    EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
+
+    ewk_view_main_frame_scrollbar_visible_set(impl->view(), false);
+    evas_object_smart_callback_call(impl->view(), "fullscreen,enterfullscreen", 0);
+    return true;
+}
+
+Eina_Bool _ewk_view_smart_fullscreen_exit(Ewk_View_Smart_Data* smartData)
+{
+    EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
+
+    ewk_view_main_frame_scrollbar_visible_set(impl->view(), true);
+    evas_object_smart_callback_call(impl->view(), "fullscreen,exitfullscreen", 0);
+    return true;
+}
+#endif
+
 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
 Eina_Bool _ewk_view_text_selection_down(Ewk_View_Smart_Data* smartData, int x, int y)
 {
     EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
 
-    return impl->pageClient->textSelectionDown(IntPoint(x, y), true);
+    return impl->pageClient->textSelectionDown(IntPoint(x, y));
 }
 
 Eina_Bool _ewk_view_text_selection_move(Ewk_View_Smart_Data* smartData, int x, int y)
@@ -685,7 +711,7 @@ Eina_Bool _ewk_view_text_selection_move(Ewk_View_Smart_Data* smartData, int x, i
     EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
 
     IntPoint point(x, y);
-    impl->pageClient->textSelectionMove(point, true);
+    impl->pageClient->textSelectionMove(point);
 
     return true;
 }
@@ -744,11 +770,11 @@ Eina_Bool _ewk_view_smart_formdata_candidate_is_showing(Ewk_View_Smart_Data* sma
 #endif
 
 #if ENABLE(TIZEN_SCREEN_READER)
-Eina_Bool _ewk_view_screen_reader_command_execute(Ewk_View_Smart_Data* smartData, unsigned int command, int data1, int data2)
+Eina_Bool _ewk_view_screen_reader_action_execute(Ewk_View_Smart_Data* smartData, void* actionInfo)
 {
     EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
 
-    return ScreenReaderProxy::screenReader().executeCommand(impl, command, data1, data2);
+    return ScreenReaderProxy::executeAction(impl, 0, static_cast<Elm_Access_Action_Info*>(actionInfo));
 }
 #endif
 #endif // #if OS(TIZEN)
@@ -757,9 +783,11 @@ static Evas_Smart_Class g_parentSmartClass = EVAS_SMART_CLASS_INIT_NULL;
 
 static void _ewk_view_impl_del(EwkViewImpl* impl)
 {
+#if !ENABLE(TIZEN_ICON_DATABASE)
     /* Unregister icon change callback */
     Ewk_Favicon_Database* iconDatabase = impl->context->faviconDatabase();
     iconDatabase->unwatchChanges(_ewk_view_on_favicon_changed);
+#endif
 
     delete impl;
 }
@@ -815,10 +843,6 @@ static void _ewk_view_smart_add(Evas_Object* ewkView)
     // elementary steal webview's focus during mouse up event
     // So, added code that events are not propagated to smart parent according to guide from EFL
     evas_object_propagate_events_set(ewkView, false);
-
-#if ENABLE(TIZEN_SCREEN_READER)
-    ScreenReaderProxy::screenReader().addView(smartData->priv);
-#endif
 #endif // #if OS(TIZEN)
 
 #define CONNECT(s, c) evas_object_event_callback_add(ewkView, s, c, smartData)
@@ -837,7 +861,12 @@ static void _ewk_view_smart_del(Evas_Object* ewkView)
     EwkViewImpl::removeFromPageViewMap(ewkView);
     EWK_VIEW_SD_GET(ewkView, smartData);
 #if ENABLE(TIZEN_SCREEN_READER)
-    ScreenReaderProxy::screenReader().removeView(smartData->priv);
+    ScreenReaderProxy::screenReader().finalize(smartData->priv);
+#endif
+#if ENABLE(TIZEN_INPUT_COLOR_PICKER)
+    // Close color picker if it's opened.
+    if (smartData && smartData->priv && smartData->priv->inputPicker->isColorPickerShown())
+        ewk_view_color_picker_color_set(ewkView, 0, 0, 0, 0);
 #endif
     if (smartData && smartData->priv)
         _ewk_view_impl_del(smartData->priv);
@@ -859,6 +888,17 @@ static void _ewk_view_smart_resize(Evas_Object* ewkView, Evas_Coord width, Evas_
 #if ENABLE(TIZEN_WEBKIT2_TILED_AC)
     evas_object_image_native_surface_set(smartData->image, 0);
 
+#if ENABLE(TIZEN_WEBKIT2_VIEW_VISIBILITY)
+    if (impl->pageClient->isVisible()) {
+        Ecore_Evas* ee = ecore_evas_ecore_evas_get(smartData->base.evas);
+        impl->pageClient->updateViewportSize(IntSize(width, height), ecore_evas_rotation_get(ee));
+    } else
+        impl->pageClient->setDeferUpdateViewportSize(true);
+#else
+    Ecore_Evas* ee = ecore_evas_ecore_evas_get(smartData->base.evas);
+    impl->pageClient->updateViewportSize(IntSize(width, height), ecore_evas_rotation_get(ee));
+#endif
+
 #if ENABLE(TIZEN_RUNTIME_BACKEND_SELECTION)
     if (!ewk_view_is_opengl_backend(ewkView))
         _ewk_view_composite(smartData);
@@ -927,7 +967,14 @@ static void _ewk_view_smart_calculate(Evas_Object* ewkView)
                 drawingArea->setSize(IntSize(width, height), IntSize());
 #endif
 #if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE) && !ENABLE(TIZEN_WEBKIT2_EFL_WTR)
-                impl->pageClient->updateViewportSize(IntSize(width, height));
+                Ecore_Evas* ee = ecore_evas_ecore_evas_get(smartData->base.evas);
+                int newAngle = ecore_evas_rotation_get(ee);
+#if ENABLE(TIZEN_WEBKIT2_VIEW_VISIBILITY)
+                if (impl->pageClient->deferUpdateViewportSize()) {
+                    impl->pageClient->updateViewportSize(IntSize(width, height), newAngle);
+                }
+#endif
+                impl->pageClient->updateVisibleContentRectSize(IntSize(width, height));
                 if (ewk_view_is_opengl_backend(ewkView))
                     impl->pageClient->displayViewport();
 #endif
@@ -951,6 +998,9 @@ static void _ewk_view_smart_calculate(Evas_Object* ewkView)
 #if ENABLE(TIZEN_SCREEN_READER)
         impl->pageProxy->recalcScreenReaderFocusRect();
 #endif
+#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
+        impl->pageClient->updateTextSelectionHandlesAndContextMenu(true);
+#endif
 #endif // #if OS(TIZEN)
     }
 #if OS(TIZEN)
@@ -967,6 +1017,10 @@ static void _ewk_view_smart_show(Evas_Object* ewkView)
     if (evas_object_clipees_get(smartData->base.clipper))
         evas_object_show(smartData->base.clipper);
     evas_object_show(smartData->image);
+
+#if ENABLE(TIZEN_SCREEN_READER)
+    ScreenReaderProxy::screenReader().initialize(impl);
+#endif
 }
 
 static void _ewk_view_smart_hide(Evas_Object* ewkView)
@@ -1052,6 +1106,11 @@ Eina_Bool ewk_view_smart_class_set(Ewk_View_Smart_Class* api)
     api->gesture_end = _ewk_view_smart_gesture_end;
     api->gesture_move = _ewk_view_smart_gesture_move;
 
+#if ENABLE(TIZEN_FULLSCREEN_API)
+    api->fullscreen_enter = _ewk_view_smart_fullscreen_enter;
+    api->fullscreen_exit = _ewk_view_smart_fullscreen_exit;
+#endif
+
 #if ENABLE(TIZEN_WEBKIT2_POPUP_INTERNAL)
     api->popup_menu_show = _ewk_view_popup_menu_show;
 #if ENABLE(TIZEN_MULTIPLE_SELECT)
@@ -1087,7 +1146,7 @@ Eina_Bool ewk_view_smart_class_set(Ewk_View_Smart_Class* api)
     api->formdata_candidate_is_showing = _ewk_view_smart_formdata_candidate_is_showing;
 #endif
 #if ENABLE(TIZEN_SCREEN_READER)
-    api->screen_reader_command_execute = _ewk_view_screen_reader_command_execute;
+    api->screen_reader_action_execute = _ewk_view_screen_reader_action_execute;
 #endif
 #endif //#if OS(TIZEN)
 
@@ -1138,11 +1197,6 @@ static void _ewk_view_initialize(Evas_Object* ewkView, PassRefPtr<Ewk_Context> c
     impl->pageProxy->pageGroup()->preferences()->setForceCompositingMode(true);
     impl->pageProxy->pageGroup()->preferences()->setFrameFlatteningEnabled(true);
     impl->pageProxy->pageGroup()->preferences()->setAllowUniversalAccessFromFileURLs(true);
-
-    int deviceWidth, deviceHeight;
-    ecore_evas_screen_geometry_get(ecore_evas_ecore_evas_get(evas_object_evas_get(ewkView)), 0, 0, &deviceWidth, &deviceHeight);
-    impl->pageProxy->pageGroup()->preferences()->setDeviceWidth(deviceWidth);
-    impl->pageProxy->pageGroup()->preferences()->setDeviceHeight(deviceHeight);
 #endif
 
     impl->pageProxy->initializeWebPage();
@@ -1215,11 +1269,11 @@ static void _ewk_view_initialize(Evas_Object* ewkView, PassRefPtr<Ewk_Context> c
     impl->resourceLoadClient = ResourceLoadClientEfl::create(impl);
     impl->findClient = FindClientEfl::create(impl);
     impl->formClient = FormClientEfl::create(impl);
-
+#if !ENABLE(TIZEN_ICON_DATABASE)
     /* Listen for favicon changes */
     Ewk_Favicon_Database* iconDatabase = impl->context->faviconDatabase();
     iconDatabase->watchChanges(IconChangeCallbackData(_ewk_view_on_favicon_changed, ewkView));
-
+#endif
 #if ENABLE(TIZEN_WEBKIT2_THEME_SET_INTERNAL)
     ewk_view_theme_set(ewkView, "/usr/share/edje/webkit.edj");
 #endif
@@ -1338,7 +1392,7 @@ Eina_Bool ewk_view_url_set(Evas_Object* ewkView, const char* url)
     EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
     EINA_SAFETY_ON_NULL_RETURN_VAL(url, false);
 
-    impl->pageProxy->loadURL(url);
+    impl->pageProxy->loadURL(String::fromUTF8(url));
     impl->informURLChange();
 
     return true;
@@ -1365,6 +1419,7 @@ Eina_Bool ewk_view_reload(Evas_Object* ewkView)
     EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
     EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
 
+    impl->pageClient->prepareRestoredVisibleContectRect();
     impl->pageProxy->reload(/*reloadFromOrigin*/ false);
     impl->informURLChange();
 
@@ -1573,10 +1628,6 @@ void ewk_view_text_change_in_textfield(Evas_Object* ewkView, const String& name,
     if (!ewk_settings_form_candidate_data_enabled_get(ewk_view_settings_get(ewkView)))
         return;
 
-    InputMethodContextEfl* imfContext = impl->inputMethodContext();
-    if (!imfContext || !imfContext->isShow())
-        return;
-
     if (value.isEmpty()) {
         if(smartData->api->formdata_candidate_is_showing(smartData))
             smartData->api->formdata_candidate_hide(smartData);
@@ -1601,10 +1652,7 @@ void ewk_view_text_change_in_textfield(Evas_Object* ewkView, const String& name,
 
     smartData->api->formdata_candidate_update_data(smartData, candidateList);
 
-    if (!smartData->api->formdata_candidate_is_showing(smartData))
-        smartData->api->formdata_candidate_hide(smartData);
-
-    IntRect inputFieldRect = impl->pageClient->focusedNodeRect();
+    IntRect inputFieldRect = impl->transformToScene().mapRect(impl->pageClient->focusedNodeRect());
     smartData->api->formdata_candidate_show(smartData, inputFieldRect.x(), inputFieldRect.y(), inputFieldRect.width(), inputFieldRect.height());
 }
 
@@ -1632,15 +1680,18 @@ void ewk_view_form_password_data_fill(Evas_Object* ewkView)
     if (!passwordFormData.size())
         return;
 
-    String passwordFormAutofill = "try { function passwordFormAutofill() { var inputFields;";
+    String passwordFormAutofill = String::fromUTF8("try { function passwordFormAutofill() { var inputFields;");
     for (size_t i = 0; i < passwordFormData.size(); i++) {
-        passwordFormAutofill += String::format(" inputFields = document.getElementsByName(\"%s\");"
-            " for (var i = 0; i < inputFields.length; i++)"
-            " if (inputFields[i].tagName.toLowerCase() == \"input\" && (inputFields[i].type.toLowerCase() == \"text\" || inputFields[i].type.toLowerCase() == \"password\"))"
-            " inputFields[i].value = \"%s\";",
-            passwordFormData[i].first.utf8().data(), passwordFormData[i].second.utf8().data());
+        passwordFormAutofill += String::fromUTF8(" inputFields = document.getElementsByName(\"");
+        passwordFormAutofill += passwordFormData[i].first;
+        passwordFormAutofill += String::fromUTF8("\");");
+        passwordFormAutofill += String::fromUTF8(" for (var i = 0; i < inputFields.length; i++)");
+        passwordFormAutofill += String::fromUTF8(" if (inputFields[i].tagName.toLowerCase() == \"input\" && (inputFields[i].type.toLowerCase() == \"text\" || inputFields[i].type.toLowerCase() == \"password\" || inputFields[i].type.toLowerCase() == \"email\"))");
+        passwordFormAutofill += String::fromUTF8(" inputFields[i].value = \"");
+        passwordFormAutofill += passwordFormData[i].second;
+        passwordFormAutofill += String::fromUTF8("\";");
     }
-    passwordFormAutofill += "} passwordFormAutofill(); } catch(e) { }";
+    passwordFormAutofill += String::fromUTF8("} passwordFormAutofill(); } catch(e) { }");
     ewk_view_script_execute(ewkView, passwordFormAutofill.utf8().data(), 0, 0);
 }
 
@@ -1941,6 +1992,10 @@ void ewkViewLoadCommitted(Evas_Object* ewkView)
     EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
     impl->gestureClient->reset();
 #endif
+#if ENABLE(TIZEN_WEBKIT2_FOCUS_RING)
+    if (impl->focusRing)
+        impl->focusRing->hide();
+#endif
 #if ENABLE(TIZEN_ISF_PORT)
     impl->inputMethodContext()->hideIMFContext();
 #endif
@@ -1990,22 +2045,25 @@ void ewk_view_process_crashed(Evas_Object* ewkView)
 }
 
 #if ENABLE(TIZEN_SQL_DATABASE)
-unsigned long long ewkViewExceededDatabaseQuota(Evas_Object* ewkView, WKSecurityOriginRef origin, WKStringRef databaseName, WKStringRef displayName, unsigned long long currentQuota, unsigned long long currentOriginUsage, unsigned long long currentDatabaseUsage, unsigned long long expectedUsage)
+bool ewkViewExceededDatabaseQuota(Evas_Object* ewkView, WKSecurityOriginRef origin, WKStringRef databaseName, unsigned long long expectedUsage)
 {
-    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, currentQuota);
-    EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, currentQuota);
+    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
+    EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
 
-    TIZEN_LOGI("database,quota,exceeded");
-    uint64_t defaultQuota = ewkContextGetDatabaseQuota(impl->context.get());
-    if (defaultQuota >= expectedUsage + currentQuota)
-        return defaultQuota;
+    if (!impl->exceededDatabaseQuotaContext || !impl->exceededDatabaseQuotaContext->exceededDatabaseQuotaCallback)
+        return false;
+
+    TIZEN_LOGI("No error in prameter. Request to display user confirm popup. expectedUsage(%llu)", expectedUsage);
+    impl->isWaitingForExceededQuotaPopupReply = true;
+    if (impl->exceededQuotaOrigin)
+        deleteSecurityOrigin(impl->exceededQuotaOrigin);
+    impl->exceededQuotaOrigin = createSecurityOrigin(origin);
 
-    if (impl->exceededDatabaseQuota)
-        ewkContextDeleteExceededQuota(impl->exceededDatabaseQuota);
-    impl->exceededDatabaseQuota = ewkContextCreateExceededQuota(origin, databaseName, displayName, currentQuota, currentOriginUsage, currentDatabaseUsage, expectedUsage);
-    evas_object_smart_callback_call(ewkView, "database,quota,exceeded", impl->exceededDatabaseQuota);
+    int length = WKStringGetMaximumUTF8CStringSize(databaseName);
+    OwnArrayPtr<char> databaseNameBuffer = adoptArrayPtr(new char[length]);
+    WKStringGetUTF8CString(databaseName, databaseNameBuffer.get(), length);
 
-    return ewkContextGetNewQuotaForExceededQuota(impl->context.get(), impl->exceededDatabaseQuota);
+    return impl->exceededDatabaseQuotaContext->exceededDatabaseQuotaCallback(ewkView, impl->exceededQuotaOrigin, databaseNameBuffer.get(), expectedUsage, impl->exceededDatabaseQuotaContext->userData) == EINA_TRUE;
 }
 #endif
 
@@ -2462,7 +2520,6 @@ bool ewk_view_focused_node_adjust(Evas_Object* ewkView, Eina_Bool adjustForExter
         return false;
 #endif
 
-    IntSize visibleSize(smartData->view.w, smartData->view.h);
     // caret position can be outside of visible rect.
     // we need to consider it.
     IntRect selectionRect = impl->pageProxy->getSelectionRect(true);
@@ -2477,13 +2534,21 @@ bool ewk_view_focused_node_adjust(Evas_Object* ewkView, Eina_Bool adjustForExter
     if (selectionRect.isEmpty())
         return false;
 
-    // set paddings
-    IntPoint scrollPosition(selectionRect.x() - visibleSize.width() / 3, selectionRect.y() - visibleSize.height() / 3);
-    // If both input field's position x and selection rect can be displayed together,
-    // adjust scroll position to input field's position x.
-    if (!focusedNodeRect.isEmpty()
-        && selectionRect.x() - focusedNodeRect.x() < visibleSize.width() * 4 / 5)
-        scrollPosition.setX(focusedNodeRect.x());
+    IntRect visibleRect = impl->pageClient->visibleContentRect();
+    IntPoint scrollPosition = visibleRect.location();
+    // Do not adjust scroll position if content is userscalable or selection rect (caret) is visible after scaling
+    if (impl->pageClient->userScalable() || !visibleRect.contains(selectionRect)) {
+        // set paddings
+        scrollPosition = IntPoint(selectionRect.x() - visibleRect.width() / 3, selectionRect.y() - visibleRect.height() / 3);
+        // If both input field's position x and selection rect can be displayed together,
+        // adjust scroll position to input field's position x.
+        if (!focusedNodeRect.isEmpty() && selectionRect.x() - focusedNodeRect.x() < visibleRect.width() * 4 / 5)
+            scrollPosition.setX(focusedNodeRect.x());
+    }
+
+#if ENABLE(TIZEN_DLOG_SUPPORT)
+    TIZEN_LOGI("scroll position: [%d, %d], scale factor: [%.2f]", scrollPosition.x(), scrollPosition.y(), newScaleFactor);
+#endif
 
 #if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
     impl->pageClient->setVisibleContentRect(IntRect(scrollPosition, impl->size()), newScaleFactor);
@@ -2525,7 +2590,8 @@ static Eina_Bool _ewk_view_composite(void* data)
     evas_object_image_data_set(smartData->image, pixels);
     evas_object_image_data_update_add(smartData->image, 0, 0, ow, oh);
 
-    ewkViewFrameRendered(smartData->self);
+    if (impl->pageClient->notifiedNonemptyLayout())
+        ewkViewFrameRendered(smartData->self);
 
     impl->compositionAnimator = 0;
 
@@ -2620,6 +2686,7 @@ void ewk_view_suspend(Evas_Object* ewkView)
     // Multiple suspend of ActiveDOMObject makes unintended suspend/resume status of
     // the ActiveDOMObject.
     if (!impl->suspendedResources && (!impl->isWaitingForJavaScriptPopupReply || !impl->isWaitingForApplicationCachePermission || !impl->isWaitingForExceededQuotaPopupReply)) {
+        impl->pageProxy->suspendAnimations();
         impl->pageProxy->suspendJavaScriptAndResource();
         impl->suspendedResources = true;
     }
@@ -2652,6 +2719,7 @@ void ewk_view_resume(Evas_Object* ewkView)
     // Multiple suspend of ActiveDOMObject makes unintended suspend/resume status of
     // the ActiveDOMObject.
     if (impl->suspendedResources && (!impl->isWaitingForJavaScriptPopupReply || !impl->isWaitingForApplicationCachePermission || !impl->isWaitingForExceededQuotaPopupReply)) {
+        impl->pageProxy->resumeAnimations();
         impl->pageProxy->resumeJavaScriptAndResource();
         impl->suspendedResources = false;
     }
@@ -2875,6 +2943,13 @@ Eina_Bool ewk_view_visibility_set(Evas_Object* ewkView, Eina_Bool enable)
 }
 #endif
 
+#if ENABLE(TIZEN_BACKGROUND_DISK_CACHE)
+Eina_Bool ewk_view_foreground_set(Evas_Object* ewkView, Eina_Bool enable)
+{
+    return true;
+}
+#endif
+
 Evas_Object* ewk_view_screenshot_contents_get(const Evas_Object* ewkView, Eina_Rectangle viewArea, float scaleFactor, Evas* canvas)
 {
     EINA_SAFETY_ON_NULL_RETURN_VAL(canvas, 0);
@@ -2920,26 +2995,26 @@ Evas_Object* ewk_view_screenshot_contents_get(const Evas_Object* ewkView, Eina_R
 
 unsigned int ewk_view_inspector_server_start(Evas_Object* ewkView, unsigned int port)
 {
-#if ENABLE(TIZEN_WEBKIT2_REMOTE_WEB_INSPECTOR)
+#if ENABLE(TIZEN_REMOTE_WEB_INSPECTOR)
     EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, 0);
     EWK_VIEW_IMPL_GET_OR_RETURN(sd, impl, 0);
 
     return impl->pageProxy->startInspectorServer(port);
 #else
-    LOG_ERROR("TIZEN_WEBKIT2_REMOTE_WEB_INSPECTOR is disabled.\n");
+    LOG_ERROR("TIZEN_REMOTE_WEB_INSPECTOR is disabled.\n");
     return 0;
 #endif
 }
 
 Eina_Bool ewk_view_inspector_server_stop(Evas_Object* ewkView)
 {
-#if ENABLE(TIZEN_WEBKIT2_REMOTE_WEB_INSPECTOR)
+#if ENABLE(TIZEN_REMOTE_WEB_INSPECTOR)
     EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, false);
     EWK_VIEW_IMPL_GET_OR_RETURN(sd, impl, false);
 
     return impl->pageProxy->stopInspectorServer();
 #else
-    LOG_ERROR("TIZEN_WEBKIT2_REMOTE_WEB_INSPECTOR is disabled.\n");
+    LOG_ERROR("TIZEN_REMOTE_WEB_INSPECTOR is disabled.\n");
     return false;
 #endif
 }
@@ -3000,6 +3075,16 @@ Eina_Bool ewk_view_scroll_size_get(const Evas_Object* ewkView, int* width, int*
     return true;
 }
 
+#if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
+void ewkViewNotifyPopupReplyWaitingState(Evas_Object* ewkView, bool isWaiting)
+{
+    if (isWaiting)
+        evas_object_smart_callback_call(ewkView, "popup,reply,wait,start", 0);
+    else
+        evas_object_smart_callback_call(ewkView, "popup,reply,wait,finish", 0);
+}
+#endif
+
 bool ewkViewRunJavaScriptAlert(Evas_Object* ewkView, WKStringRef alertText)
 {
     EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
@@ -3229,7 +3314,7 @@ void ewk_view_open_panel_reply(Evas_Object* ewkView, Eina_List* fileUrls, Eina_B
     unsigned int i = 0;
     KURL base(KURL(), "file://");
     EINA_LIST_FOREACH(fileUrls, list, data) {
-        KURL url(base, static_cast<char*>(data));
+        KURL url(base, String::fromUTF8(static_cast<char*>(data)));
         items[i++] = WKURLCreateWithUTF8CString(url.string().utf8().data());
     }
     WKRetainPtr<WKArrayRef> filesArray(AdoptWK, WKArrayCreate(items, size));
@@ -3634,12 +3719,7 @@ Ewk_History* ewk_view_history_get(Evas_Object* ewkView)
 
 Eina_Bool ewk_view_recording_surface_enable_set(Evas_Object* ewkView, Eina_Bool enable)
 {
-    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
-    EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
-
-    WKPageRecordingSurfaceSetEnable(toAPI(impl->pageProxy.get()), enable);
-
-    return true;
+    return false;
 }
 
 Eina_Bool ewk_view_notification_closed(Evas_Object* ewkView, Eina_List* ewkNotifications)
@@ -3882,6 +3962,14 @@ Eina_Bool ewk_view_auto_clear_text_selection_mode_get(Evas_Object* ewkView)
 {
     return ewk_settings_clear_text_selection_automatically_get(ewk_view_settings_get(ewkView));
 }
+
+void ewk_view_text_selection_range_clear(Evas_Object* ewkView)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
+    EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
+
+    impl->pageProxy->selectionRangeClear();
+}
 #endif // #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
 
 #if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
@@ -4080,17 +4168,33 @@ void ewk_view_touch_event_handler_result_set(Evas_Object* ewkView, WebKit::WebEv
         if (impl->wasHandledTouchMove != wasHandled)
             evas_object_smart_callback_call(ewkView, "touchmove,handled", static_cast<void*>(&wasHandled));
         impl->wasHandledTouchMove = wasHandled;
-    } else if (type == WebEvent::TouchEnd && !impl->exceedTouchMoveThreshold && !wasHandled) {
-        impl->gestureClient->setMovingEnabled(!wasHandled);
-        impl->gestureClient->setTapEnabled(!wasHandled);
+    } else if (type == WebEvent::TouchEnd && !impl->exceedTouchMoveThreshold) {
+        if (!wasHandled) {
+            impl->gestureClient->setMovingEnabled(!wasHandled);
+            impl->gestureClient->setTapEnabled(!wasHandled);
+        }
+#if ENABLE(TIZEN_ISF_PORT)
+        else if (impl->pageProxy->isViewVisible()) {
+            IntPoint pointForHitTest = impl->transformFromScene().mapPoint(IntPoint(impl->touchDownPoint.x, impl->touchDownPoint.y));
+            WebHitTestResult::Data hitTestResultData = impl->pageProxy->hitTestResultAtPoint(pointForHitTest);
+            if (hitTestResultData.isContentEditable && impl->inputMethodContext()) {
+                evas_object_focus_set(ewkView, true);
+                impl->inputMethodContext()->updateTextInputState();
+            }
+        }
+#endif
     }
 #endif
 }
 
 #if ENABLE(TIZEN_WEBKIT2_GET_TEXT_STYLE_FOR_SELECTION)
-void  ewkViewDidGetTextStyleStateForSelection(Evas_Object* ewkView, int underlineState, int italicState, int boldState, const IntPoint& startPoint, const IntPoint& endPoint)
+void  ewkViewTextStyleState(Evas_Object* ewkView, const IntPoint& startPoint, const IntPoint& endPoint)
 {
-    Ewk_Text_Style* textStyle = ewkTextStyleCreate(underlineState, italicState, boldState, startPoint, endPoint);
+    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
+    EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
+
+    EditorState editorState = impl->page()->editorState();
+    Ewk_Text_Style* textStyle = ewkTextStyleCreate(editorState, startPoint, endPoint);
     evas_object_smart_callback_call(ewkView, "text,style,state", static_cast<void*>(textStyle));
     ewkTextStyleDelete(textStyle);
 }
@@ -4229,13 +4333,20 @@ Eina_Bool ewk_view_feed_touch_event(Evas_Object* ewkView, Ewk_Touch_Event_Type t
             impl->pageClient->textSelectonHandleMove(handlePoint);
         else
             impl->pageClient->textSelectonHandleUp();
+
+        if (impl->pageClient->isTextSelectionHandleDowned())
+            return true;
     }
 #endif
 
 #if ENABLE(TIZEN_GESTURE)
 #if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2)
     // We don't want to process touch event when context menu is shown.
-    if (impl->pageClient->isContextMenuVisible() && type != EWK_TOUCH_CANCEL)
+    if ((impl->pageClient->isContextMenuVisible() && type != EWK_TOUCH_CANCEL)
+#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
+        && !impl->pageClient->isTextSelectionMode()
+#endif
+        )
         return true;
 #endif
 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
@@ -4586,3 +4697,133 @@ Eina_Bool ewk_view_text_matches_count(Evas_Object* ewkView, const char* text, Ew
 
     return true;
 }
+
+void ewk_view_exceeded_database_quota_callback_set(Evas_Object* ewkView, Ewk_View_Exceeded_Database_Quota_Callback callback, void* userData)
+{
+#if ENABLE(TIZEN_SQL_DATABASE)
+    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
+    EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
+
+    if (!impl->exceededDatabaseQuotaContext)
+        impl->exceededDatabaseQuotaContext = adoptPtr<Ewk_View_Callback_Context>(new Ewk_View_Callback_Context);
+    impl->exceededDatabaseQuotaContext->exceededDatabaseQuotaCallback = callback;
+    impl->exceededDatabaseQuotaContext->userData = userData;
+#else
+    UNUSED_PARAM(ewkView);
+    UNUSED_PARAM(callback);
+    UNUSED_PARAM(userData);
+#endif
+}
+
+void ewk_view_exceeded_database_quota_reply(Evas_Object* ewkView, Eina_Bool allow)
+{
+#if ENABLE(TIZEN_SQL_DATABASE)
+    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
+    EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
+
+    TIZEN_LOGI("allow %d", allow);
+    WKPageReplyExceededDatabaseQuota(toAPI(impl->page()), allow == EINA_TRUE);
+    if (impl->exceededQuotaOrigin)
+        deleteSecurityOrigin(impl->exceededQuotaOrigin);
+    impl->exceededQuotaOrigin = 0;
+    impl->isWaitingForExceededQuotaPopupReply = false;
+#else
+    UNUSED_PARAM(ewkView);
+    UNUSED_PARAM(allow);
+#endif
+}
+
+#if ENABLE(TIZEN_FILE_SYSTEM)
+bool ewkViewExceededLocalFileSystemQuota(Evas_Object* ewkView, WKSecurityOriginRef origin, long long currentUsage)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
+    EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
+
+    if (!impl->exceededLocalFileSystemQuotaContext || !impl->exceededLocalFileSystemQuotaContext->exceededLocalFileSystemQuotaCallback)
+        return false;
+
+    impl->isWaitingForExceededQuotaPopupReply = true;
+    if (impl->exceededQuotaOrigin)
+        deleteSecurityOrigin(impl->exceededQuotaOrigin);
+    impl->exceededQuotaOrigin = createSecurityOrigin(origin);
+
+    TIZEN_LOGI("currentUsage(%lld)", currentUsage);
+
+    return impl->exceededLocalFileSystemQuotaContext->exceededLocalFileSystemQuotaCallback(ewkView, impl->exceededQuotaOrigin , currentUsage, impl->exceededLocalFileSystemQuotaContext->userData) == EINA_TRUE;
+}
+#endif
+
+void ewk_view_exceeded_local_file_system_quota_callback_set(Evas_Object* ewkView, Ewk_View_Exceeded_Indexed_Database_Quota_Callback callback, void* userData)
+{
+#if ENABLE(TIZEN_FILE_SYSTEM)
+    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
+    EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
+
+    if (!impl->exceededLocalFileSystemQuotaContext)
+        impl->exceededLocalFileSystemQuotaContext = adoptPtr<Ewk_View_Callback_Context>(new Ewk_View_Callback_Context);
+    impl->exceededLocalFileSystemQuotaContext->exceededLocalFileSystemQuotaCallback = callback;
+    impl->exceededLocalFileSystemQuotaContext->userData = userData;
+#else
+    UNUSED_PARAM(ewkView);
+    UNUSED_PARAM(callback);
+    UNUSED_PARAM(userData);
+#endif
+}
+
+void ewk_view_exceeded_local_file_system_quota_reply(Evas_Object* ewkView, Eina_Bool allow)
+{
+#if ENABLE(TIZEN_FILE_SYSTEM)
+    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
+    EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
+
+    TIZEN_LOGI("allow %d", allow);
+    WKPageReplyExceededLocalFileSystemQuota(toAPI(impl->page()), allow == EINA_TRUE);
+    if (impl->exceededQuotaOrigin)
+        deleteSecurityOrigin(impl->exceededQuotaOrigin);
+    impl->exceededQuotaOrigin = 0;
+    impl->isWaitingForExceededQuotaPopupReply = false;
+#else
+    UNUSED_PARAM(ewkView);
+    UNUSED_PARAM(result);
+#endif
+}
+
+void ewk_view_rotation_prepare(Evas_Object* ewkView, int angle)
+{
+#if ENABLE(TIZEN_PRERENDERING_FOR_ROTATION)
+    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
+    EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
+
+    int width, height;
+    if (angle == 0 || angle == 180) {
+        width = WebCore::getDefaultScreenResolution().width();
+        height = WebCore::getDefaultScreenResolution().height() + 100;
+    }
+    if (angle == 90 || angle == 270) {
+        width = WebCore::getDefaultScreenResolution().height();
+        height = WebCore::getDefaultScreenResolution().width() + 100;
+    }
+
+    impl->pageProxy->drawingArea()->setSize(IntSize(width, height), IntSize());
+    impl->pageClient->setWaitFrameOfNewViewortSize(true);
+    ewk_view_suspend(ewkView);
+    impl->pageClient->updateViewportSize(IntSize(width, height), angle);
+#endif
+}
+
+#if ENABLE(TIZEN_PRERENDERING_FOR_ROTATION)
+void ewkViewRotatePrepared(Evas_Object* ewkView)
+{
+    evas_object_smart_callback_call(ewkView, "rotate,prepared", 0);
+}
+#endif
+
+void ewk_view_use_settings_font(Evas_Object* ewkView)
+{
+#if ENABLE(TIZEN_USE_SETTINGS_FONT)
+    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
+    EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
+
+    impl->pageProxy->useSettingsFont();
+#endif
+}