[Title] Do not select range when picker input element has focus in focus ui mode
[Issue#] N_SE-52290
[Problem] Picker input element was selected in focus ui mode
[Cause] Input element's default handler did select text
[Solution] Do not select range when picker input element has focus in focus ui mode
Change-Id: Id4ef6876bfba9a46f384cd1b5aed019c25022a06
#include "TouchEvent.h"
#endif
+#if ENABLE(TIZEN_FOCUS_UI) && ENABLE(TIZEN_INPUT_TAG_EXTENSION)
+#include "Settings.h"
+#include "WindowsKeyboardCodes.h"
+#include "htmlediting.h"
+#endif
+
using namespace std;
namespace WebCore {
void HTMLInputElement::updateFocusAppearance(bool restorePreviousSelection)
{
+#if ENABLE(TIZEN_FOCUS_UI) && ENABLE(TIZEN_INPUT_TAG_EXTENSION)
+ if (shouldUsePicker() && document()->settings() && document()->settings()->isSpatialNavigationEnabled())
+ return;
+#endif
+
if (isTextField()) {
if (!restorePreviousSelection || !hasCachedSelection())
select();
m_inputType->handleKeydownEvent(static_cast<KeyboardEvent*>(evt));
if (evt->defaultHandled())
return;
+#if ENABLE(TIZEN_FOCUS_UI) && ENABLE(TIZEN_INPUT_TAG_EXTENSION)
+ if (static_cast<KeyboardEvent*>(evt)->keyCode() == VK_RETURN && shouldUsePicker()
+ && document()->settings() && document()->settings()->isSpatialNavigationEnabled()) {
+ setSelectionRange(0, 0);
+ evt->setDefaultHandled();
+ return;
+ }
+#endif
}
// Call the base event handler before any of our own event handling for almost all events in text fields.
}
#endif
+#if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
+bool HTMLInputElement::shouldUsePicker()
+{
+ return (isDateField() || isDateTimeField() || isDateTimeLocalField() || isMonthField() || isTimeField() || isWeekField());
+}
+#endif
+
} // namespace
virtual const AtomicString& name() const OVERRIDE;
+#if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
+ bool shouldUsePicker();
+#endif
+
protected:
HTMLInputElement(const QualifiedName&, Document*, HTMLFormElement*, bool createdByParser);
void createShadowSubtree();
static inline bool shouldVisit(Node* node, KeyboardEvent* event)
{
ASSERT(node);
+#if ENABLE(TIZEN_FOCUS_UI) && ENABLE(FULLSCREEN_API)
+ if (!node->isKeyboardFocusable(event) && !isNonFocusableShadowHost(node, event))
+ return false;
+
+ Element* fullscreenElement = node->document()->webkitIsFullScreen() ? node->document()->webkitFullscreenElement() : 0;
+ return (!fullscreenElement || fullscreenElement->contains(node));
+#else
return node->isKeyboardFocusable(event) || isNonFocusableShadowHost(node, event);
+#endif
}
FocusController::FocusController(Page* page)
current.focusableNode = focusedNode;
current.visibleNode = focusedNode;
+#if ENABLE(TIZEN_FOCUS_UI) && ENABLE(FULLSCREEN_API)
+ Element* fullscreenElement = node->document()->webkitIsFullScreen() ? node->document()->webkitFullscreenElement() : 0;
+#endif
+
for (; node; node = (node->isFrameOwnerElement() || canScrollInDirection(node, direction)) ? node->traverseNextSibling(container) : node->traverseNextNode(container)) {
if (node == focusedNode)
continue;
#endif
continue;
+#if ENABLE(TIZEN_FOCUS_UI) && ENABLE(FULLSCREEN_API)
+ if (fullscreenElement && !fullscreenElement->contains(node))
+ continue;
+#endif
+
FocusCandidate candidate = FocusCandidate(node, direction);
if (candidate.isNull())
continue;
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
}
void InputMethodContextEfl::showIMFContext(const EditorState& editor, bool isUserAction)
{
Ewk_Settings* settings = ewk_view_settings_get(m_viewImpl->view());
- bool isContextTransition = (m_context ? m_contextID != editor.inputMethodContextID : m_state != ECORE_IMF_INPUT_PANEL_STATE_HIDE);
+ bool isContextTransition = (m_contextID && m_contextID != editor.inputMethodContextID);
if (!isUserAction && !isContextTransition) {
if (!ewk_settings_uses_keypad_without_user_action_get(settings) || (m_focused && m_contextID == editor.inputMethodContextID))