#if ENABLE(TIZEN_GEOLOCATION)
#include "ewk_geolocation_private.h"
+#include "ewk_geolocation_provider_private.h"
#include "ewk_security_origin.h"
-#include "ewk_view_geolocation_provider.h"
#endif
#if ENABLE(TOUCH_EVENTS)
static Eina_Bool _ewk_view_input_picker_show(Ewk_View_Smart_Data*, Ewk_Input_Type, const char* inputValue);
#endif
-#if ENABLE(TIZEN_DATALIST_ELEMENT)
-static Eina_Bool _ewk_view_data_list_show(Ewk_View_Smart_Data*, Ewk_Input_Type, Eina_List*);
-static Eina_Bool _ewk_view_data_list_hide(Ewk_View_Smart_Data*, Ewk_Input_Type);
-#endif
-
#if ENABLE(TIZEN_INPUT_COLOR_PICKER)
static Eina_Bool _ewk_input_picker_color_request(Ewk_View_Smart_Data*, int, int, int, int);
static Eina_Bool _ewk_input_picker_color_dismiss(Ewk_View_Smart_Data*);
}
#endif
+#if ENABLE(TIZEN_GEOLOCATION)
+static Eina_Bool _ewk_view_geolocation_validity_check(void* eventInfo)
+{
+ Evas_Object* ewkView = static_cast<Evas_Object*>(eventInfo);
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, true);
+ EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, true);
+
+ return impl->isValidLocationService();
+}
+#endif
+
// Default Event Handling.
static Eina_Bool _ewk_view_smart_focus_in(Ewk_View_Smart_Data* smartData)
{
return true;
}
+#if ENABLE(TIZEN_FOCUS_UI)
+bool isFocusUIActivationKeyname(const char* key)
+{
+ return !strcmp(key, "Up") || !strcmp(key, "Down") || !strcmp(key, "Left") || !strcmp(key, "Right") || !strcmp(key, "Tab");
+}
+#endif
+
static Eina_Bool _ewk_view_smart_key_down(Ewk_View_Smart_Data* smartData, const Evas_Event_Key_Down* downEvent)
{
EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
+#if ENABLE(TIZEN_FOCUS_UI)
+ if (InputMethodContextEfl::shouldUseExternalKeyboard() && !impl->page()->focusUIEnabled()) {
+ if (isFocusUIActivationKeyname(downEvent->keyname))
+ impl->page()->setFocusUIEnabled(true);
+ return false;
+ }
+#endif
+
bool isFiltered = false;
InputMethodContextEfl* inputMethodContext = impl->inputMethodContext();
if (inputMethodContext)
inputMethodContext->handleKeyDownEvent(downEvent, &isFiltered);
+#if ENABLE(TIZEN_ISF_PORT)
+ NativeWebKeyboardEvent nativeEvent(downEvent, isFiltered);
+ nativeEvent.setInputMethodContextID(impl->pageProxy->editorState().inputMethodContextID);
+ impl->pageProxy->handleKeyboardEvent(nativeEvent);
+#else
impl->pageProxy->handleKeyboardEvent(NativeWebKeyboardEvent(downEvent, isFiltered));
+#endif
+
return true;
}
{
EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
+#if ENABLE(TIZEN_FOCUS_UI)
+ if (InputMethodContextEfl::shouldUseExternalKeyboard() && !impl->page()->focusUIEnabled())
+ return false;
+#endif
+
impl->pageProxy->handleKeyboardEvent(NativeWebKeyboardEvent(upEvent));
return true;
}
#if ENABLE(TIZEN_WEBKIT2_FOCUS_RING)
FocusRing* focusRing = impl->focusRing();
if (focusRing) {
- if (event->type == EWK_GESTURE_TAP && event->count == 1) {
- focusRing->requestToShow(IntPoint(event->position.x, event->position.y));
+ if (event->type == EWK_GESTURE_TAP) {
+ if (event->count == 1)
+ focusRing->requestToShow(IntPoint(event->position.x, event->position.y));
} else if (event->type == EWK_GESTURE_PAN) {
if (impl->exceedTouchMoveThreshold)
focusRing->requestToHide();
- } else {
- if (event->type != EWK_GESTURE_LONG_PRESS) {
+ } else if (event->type != EWK_GESTURE_LONG_PRESS) {
#if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2)
- if (!impl->pageClient->isContextMenuVisible())
+ if (!impl->pageClient->isContextMenuVisible())
#endif
- focusRing->requestToHide();
- }
+ focusRing->requestToHide();
}
}
#endif
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);
+ bool isNeed = impl->page()->fullScreenManager()->exitFullScreenByHwBackKey();
+ evas_object_smart_callback_call(impl->view(), "fullscreen,enterfullscreen", &isNeed);
return true;
}
if (smartData && smartData->priv && smartData->priv->inputPicker->isColorPickerShown())
ewk_view_color_picker_color_set(ewkView, 0, 0, 0, 0);
#endif
+
+#if ENABLE(TIZEN_GEOLOCATION)
+ if (smartData) {
+ EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
+ Ewk_Geolocation_Provider* geolocationProvider = impl->context->geolocationProvider();
+ TIZEN_LOGI("_ewk_view_smart_del:: unwatch validity");
+ geolocationProvider->unwatchValidity(ewkView);
+ }
+#endif
+
if (smartData && smartData->priv)
_ewk_view_impl_del(smartData->priv);
#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);
#endif
#if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE) && !ENABLE(TIZEN_WEBKIT2_EFL_WTR)
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();
impl->pageClient->frameRectChanged();
#endif
#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
- impl->pageClient->updateTextSelectionHandlesAndContextMenu(true);
+ if (impl->pageClient->isTextSelectionMode()) {
+ impl->pageClient->updateTextSelectionHandlesAndContextMenu(false);
+ impl->pageClient->requestToShowTextSelectionHandlesAndContextMenu();
+ }
#endif
#if ENABLE(TIZEN_WEBKIT2_FOCUS_RING)
if (impl->focusRing())
#if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
api->input_picker_show = _ewk_view_input_picker_show;
#endif
-#if ENABLE(TIZEN_DATALIST_ELEMENT)
- api->data_list_show = _ewk_view_data_list_show;
- api->data_list_hide = _ewk_view_data_list_hide;
-#endif
#if ENABLE(TIZEN_SCREEN_ORIENTATION_SUPPORT_INTERNAL)
api->orientation_lock = _ewk_orientation_lock;
api->orientation_unlock = _ewk_orientation_unlock;
ewkViewTizenClientAttachClient(ewkView);
#if ENABLE(TIZEN_GEOLOCATION)
- ewkViewGeolocationProviderAttachProvider(ewkView, impl->context->wkContext());
+ Ewk_Geolocation_Provider* geolocationProvider = impl->context->geolocationProvider();
+ geolocationProvider->watchValidity(GeolocationValidityCallbackData(_ewk_view_geolocation_validity_check, ewkView));
#endif
#if ENABLE(TIZEN_NOTIFICATIONS)
smartData->api->formdata_candidate_show(smartData, inputFieldRect.x(), inputFieldRect.y(), inputFieldRect.width(), inputFieldRect.height());
}
-void ewk_view_form_data_add(Evas_Object* ewkView, WKDictionaryRef& formData, bool isPasswordForm)
+void ewk_view_form_data_add(Evas_Object* ewkView, WKDictionaryRef& formData, bool isPasswordForm, bool isAutoComplete)
{
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
if (!ewk_settings_autofill_password_form_enabled_get(ewk_view_settings_get(ewkView))
&& !ewk_settings_form_candidate_data_enabled_get(ewk_view_settings_get(ewkView)))
return;
+
+ // if isAutoComplete is off then return
+ if (isPasswordForm && !isAutoComplete)
+ return;
+
ewk_view_context_get(ewkView)->addFormData(impl->url(), formData, isPasswordForm);
}
if (!passwordFormData.size())
return;
- String passwordFormAutofill = String::fromUTF8("try { function passwordFormAutofill() { var inputFields;");
+ String passwordFormAutofill = "try { function passwordFormAutofill() { var inputFields;";
for (size_t i = 0; i < passwordFormData.size(); i++) {
- 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 += 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].type.toLowerCase() == \"email\")"
+ " && inputFields[i].autocomplete.toLowerCase() != \"off\")"
+ " inputFields[i].value = \"",passwordFormData[i].first.utf8().data());
+ passwordFormAutofill.append(passwordFormData[i].second);
+ passwordFormAutofill += "\";";
}
- passwordFormAutofill += String::fromUTF8("} passwordFormAutofill(); } catch(e) { }");
+ passwordFormAutofill += "} passwordFormAutofill(); } catch(e) { }";
ewk_view_script_execute(ewkView, passwordFormAutofill.utf8().data(), 0, 0);
}
}
#endif
-#if ENABLE(TIZEN_DATALIST_ELEMENT)
-static Eina_Bool _ewk_view_data_list_show(Ewk_View_Smart_Data* smartData, Ewk_Input_Type inputType, Eina_List* optionList)
-{
- EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
-
- impl->inputPicker->showDataList(inputType, optionList);
- return true;
-}
-
-static Eina_Bool _ewk_view_data_list_hide(Ewk_View_Smart_Data* smartData, Ewk_Input_Type inputType)
-{
- EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
-
- impl->inputPicker->hideDataList(inputType);
- return true;
-}
-#endif
-
#if ENABLE(TIZEN_INPUT_COLOR_PICKER)
static Eina_Bool _ewk_input_picker_color_request(Ewk_View_Smart_Data* smartData, int r, int g, int b, int a)
{
impl->geolocationPermissionRequests = eina_list_remove(impl->geolocationPermissionRequests, geolocationPermissionRequest);
}
-
-void ewkViewSetGeolocation(Evas_Object* ewkView, Ewk_Geolocation* geolocation)
-{
- EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
- EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
-
- impl->geolocation = geolocation;
-}
-
-Ewk_Geolocation* ewkViewGetGeolocation(Evas_Object* ewkView)
-{
- EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0);
- EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, 0);
-
- return impl->geolocation;
-}
-
-bool ewkViewIsValidLocationService(Evas_Object* ewkView)
-{
- TIZEN_LOGI("geolocation,valid");
-
- bool valid = true;
- evas_object_smart_callback_call(ewkView, "geolocation,valid", &valid);
- return valid;
-}
#endif
void ewkViewFormSubmit(Evas_Object* ewkView, Ewk_Form_Data* formData)
*maximumScale = constraints.maximumScale;
}
-bool ewk_view_focused_node_adjust(Evas_Object* ewkView, Eina_Bool adjustForExternalKeyboard)
+bool ewk_view_focused_node_adjust(Evas_Object* ewkView, Eina_Bool adjustForExternalKeyboard, Eina_Bool adjustForContentSizeChanged)
{
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
if ((!(static_cast<PageClient*>(impl->pageClient.get()))->isViewFocused()
|| (!adjustForExternalKeyboard && !impl->inputMethodContext())
- || (!adjustForExternalKeyboard && !impl->inputMethodContext()->isShow()))
+ || (!adjustForContentSizeChanged && impl->pageProxy->editorState().isContentRichlyEditable)
+ || (adjustForContentSizeChanged && !impl->inputMethodContext()->isShow()))
#if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_CLIPBOARD)
&& !(impl->pageClient->isClipboardWindowOpened())
#endif
return false;
#endif
+ double scaleFactor = impl->pageClient->scaleFactor();
+ IntSize contentsSize = impl->pageProxy->contentsSize();
+
+ double newScaleFactor = scaleFactor;
+ // Readable zoom value is dependent on device DPI
+ if (scaleFactor < impl->pageProxy->deviceScaleFactor()
+ && impl->pageClient->viewportConstraints().userScalable)
+ newScaleFactor = impl->pageProxy->deviceScaleFactor();
+
+ // Readable zoom value should be inside of viewport scale range
+ newScaleFactor = impl->pageClient->adjustScaleWithViewport(newScaleFactor);
+
// caret position can be outside of visible rect.
// we need to consider it.
IntRect selectionRect = impl->pageProxy->editorState().selectionRect;
IntRect focusedNodeRect = impl->pageClient->focusedNodeRect();
+ IntRect focusedNodeRectScaled = focusedNodeRect;
if (selectionRect.isEmpty())
return false;
+#if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
+ focusedNodeRectScaled.scale(newScaleFactor);
+#else
+ focusedNodeRectScaled.scale(newScaleFactor / scaleFactor);
+#endif
+
+ IntRect visibleRect = impl->pageClient->visibleContentRect();
+ if (visibleRect.contains(focusedNodeRectScaled))
+ return false;
+
#if ENABLE(TIZEN_WEBKIT2_INPUT_FIELD_ZOOM)
- impl->inputFieldZoom->startInputFieldZoom(impl->transformFromScene().mapPoint(IntPoint(focusedNodeRect.x(), focusedNodeRect.y())) ,focusedNodeRect);
+ impl->inputFieldZoom->startInputFieldZoom(impl->transformFromScene().mapPoint(IntPoint(selectionRect.x(), selectionRect.y()))
+ , IntRect(focusedNodeRect.x(), selectionRect.y(), focusedNodeRect.width(), selectionRect.height()));
#endif
return true;
IntRect leftSelectionRect;
IntRect rightSelectionRect;
- if (!impl->pageProxy->getSelectionHandlers(leftSelectionRect, rightSelectionRect)) {
+ int selectionDirection = 1;
+ if (!impl->pageProxy->getSelectionHandlers(leftSelectionRect, rightSelectionRect, selectionDirection)) {
leftRect->x = 0;
leftRect->y = 0;
leftRect->w = 0;
return ewk_settings_clear_text_selection_automatically_get(ewk_view_settings_get(ewkView));
}
-Eina_Bool ewk_view_text_selection_range_clear(Evas_Object* ewkView)
+Eina_Bool ewk_view_text_selection_clear(Evas_Object* ewkView)
{
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
impl->pageClient->setIsTextSelectionMode(false);
return isTextSelectionMode;
}
+
+Eina_Bool ewk_view_text_selection_range_clear(Evas_Object* ewkView)
+{
+ return ewk_view_text_selection_clear(ewkView);
+}
#endif // #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
#if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
}
#endif
+void ewk_view_current_target_input_element_value_set(Evas_Object* ewkView, const char* value)
+{
+#if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
+ EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
+
+ impl->pageProxy->setCurrentTargetInputElementValue(String::fromUTF8(value));
+#endif // ENABLE(TIZEN_INPUT_TAG_EXTENSION)
+}
+
void ewk_view_focused_input_element_value_set(Evas_Object* ewkView, const char* value)
{
#if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
#endif // ENABLE(TIZEN_INPUT_TAG_EXTENSION)
}
-#if ENABLE(TIZEN_DATALIST_ELEMENT)
-void ewkViewDataListShowRequest(Evas_Object* ewkView, Ewk_Input_Type inputType, Vector<String> optionList)
-{
- EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
- EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
- EINA_SAFETY_ON_NULL_RETURN(smartData->api);
- EINA_SAFETY_ON_NULL_RETURN(smartData->api->data_list_show);
-
- if (impl->dataList)
- ewkViewDataListHideRequest(ewkView, inputType);
-
- for (Vector<String>::const_iterator it = optionList.begin(); it != optionList.end(); ++it) {
- String value = *it;
- impl->dataList = eina_list_append(impl->dataList, eina_stringshare_add(value.utf8().data()));
- }
-
- smartData->api->data_list_show(smartData, inputType, impl->dataList);
-}
-
-void ewkViewDataListHideRequest(Evas_Object* ewkView, Ewk_Input_Type inputType)
-{
- EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
- EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
- EINA_SAFETY_ON_NULL_RETURN(impl->dataList);
- EINA_SAFETY_ON_NULL_RETURN(smartData->api);
- EINA_SAFETY_ON_NULL_RETURN(smartData->api->data_list_hide);
-
- impl->deleteDataList();
-
- smartData->api->data_list_hide(smartData, inputType);
-}
-#endif
-
-void ewk_view_data_list_close(Evas_Object* ewkView, const char* value)
-{
-#if ENABLE(TIZEN_DATALIST_ELEMENT)
- EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
- EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
-
- impl->deleteDataList();
-
- ewk_view_focused_input_element_value_set(ewkView, value);
-#endif
-}
-
Eina_Bool ewk_view_horizontal_panning_hold_get(Evas_Object* ewkView)
{
#if ENABLE(TIZEN_GESTURE)
evas_object_smart_callback_call(ewkView, "touchmove,handled", static_cast<void*>(&wasHandled));
impl->wasHandledTouchMove = wasHandled;
} else if (type == WebEvent::TouchEnd && !impl->exceedTouchMoveThreshold) {
- if (!wasHandled) {
- impl->gestureClient->setMovingEnabled(!wasHandled);
+ if (!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();
- }
+ if (hitTestResultData.isContentEditable && impl->inputMethodContext())
+ impl->inputMethodContext()->updateTextInputStateByUserAction(true);
}
#endif
}
#if ENABLE(TIZEN_FOCUS_UI)
if (type == EWK_TOUCH_START)
- impl->page()->setSpatialNavigationEnabled(false);
+ impl->page()->setFocusUIEnabled(false);
#endif
#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION) && ENABLE(TIZEN_WEBKIT2_FOR_MOVING_TEXT_SELECTION_HANDLE_FROM_OSP)