Fixed selection should not be working when long tap on button in OSP app.
authorYuni Jeong <yhnet.jung@samsung.com>
Tue, 2 Jul 2013 15:59:06 +0000 (00:59 +0900)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Wed, 3 Jul 2013 06:51:04 +0000 (06:51 +0000)
[Title] Fixed selection should not be working when long tap on button in OSP app.
[Issue#] N_SE-44397
[Problem] After long tap on button, when selecting "copy"/"paste" context menu,
          "copy"/"paste" operation is not working.
[Cause] When long tap on button, selection should not be working.
        But, selection is working when long tap on button in OSP app.
[Solution] Remove if (!isStartedTextSelectionOutside) condition for not selecting when the input type is button.

Change-Id: If9eb4413df1e0a01c3e6df56da10954c468dc034

Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp
Source/WebKit2/UIProcess/API/efl/PageClientImpl.h
Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
Source/WebKit2/UIProcess/API/efl/tizen/TextSelection.cpp
Source/WebKit2/UIProcess/API/efl/tizen/TextSelection.h
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp

index 6ec2bfb..5b7a5f9 100755 (executable)
@@ -1130,7 +1130,7 @@ void PageClientImpl::updateTextSelectionHandlesAndContextMenu(bool isShow, bool
         m_textSelection->updateHandlesAndContextMenu(isShow, isScrolling);
 }
 
-bool PageClientImpl::textSelectionDown(const WebCore::IntPoint& point, bool isStartedTextSelectionFromOutside)
+bool PageClientImpl::textSelectionDown(const WebCore::IntPoint& point)
 {
     if (!evas_object_focus_get(m_viewImpl->view())) {
         InputMethodContextEfl* inputMethodContext = m_viewImpl->inputMethodContext();
@@ -1140,12 +1140,12 @@ bool PageClientImpl::textSelectionDown(const WebCore::IntPoint& point, bool isSt
         evas_object_focus_set(m_viewImpl->view(), true);
     }
 
-    return m_textSelection->textSelectionDown(point, isStartedTextSelectionFromOutside);
+    return m_textSelection->textSelectionDown(point);
 }
 
-void PageClientImpl::textSelectionMove(const WebCore::IntPoint& point, bool isStartedTextSelectionFromOutside)
+void PageClientImpl::textSelectionMove(const WebCore::IntPoint& point)
 {
-    m_textSelection->textSelectionMove(point, isStartedTextSelectionFromOutside);
+    m_textSelection->textSelectionMove(point);
 }
 
 void PageClientImpl::textSelectionUp(const WebCore::IntPoint& point, bool isStartedTextSelectionFromOutside)
index fcfbdbb..77443b8 100755 (executable)
@@ -171,8 +171,8 @@ public:
     bool isTextSelectionMode();
     void setIsTextSelectionMode(bool isTextSelectionMode);
     void updateTextSelectionHandlesAndContextMenu(bool isShow, bool isScrolling = false);
-    bool textSelectionDown(const WebCore::IntPoint& point, bool isStartedTextSelectionFromOutside = false);
-    void textSelectionMove(const WebCore::IntPoint& point, bool isStartedTextSelectionFromOutside = false);
+    bool textSelectionDown(const WebCore::IntPoint& point);
+    void textSelectionMove(const WebCore::IntPoint& point);
     void textSelectionUp(const WebCore::IntPoint& point, bool isStartedTextSelectionFromOutside = false);
     bool isTextSelectionHandleDowned();
 #if ENABLE(TIZEN_WEBKIT2_FOR_MOVING_TEXT_SELECTION_HANDLE_FROM_OSP)
index fe3a5b7..24dcf69 100755 (executable)
@@ -704,7 +704,7 @@ Eina_Bool _ewk_view_text_selection_down(Ewk_View_Smart_Data* smartData, int x, i
 {
     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)
@@ -712,7 +712,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;
 }
index c794f9a..088e76d 100755 (executable)
@@ -476,7 +476,7 @@ Eina_Bool TextSelection::moveAnimatorCallback(void* data)
 
 // 'return false' means text selection is not possible for point.
 // 'return true' means text selection is possible.
-bool TextSelection::textSelectionDown(const IntPoint& point, bool isStartedTextSelectionFromOutside)
+bool TextSelection::textSelectionDown(const IntPoint& point)
 {
     // text selection should be ignored when longtap on handle from osp
     if (!isEnabled() && isTextSelectionHandleDowned())
@@ -488,7 +488,7 @@ bool TextSelection::textSelectionDown(const IntPoint& point, bool isStartedTextS
     setIsTextSelectionMode(false);
 
     IntPoint contentsPoint = m_viewImpl->transformFromScene().mapPoint(point);
-    bool result = m_viewImpl->page()->selectClosestWord(contentsPoint, isStartedTextSelectionFromOutside);
+    bool result = m_viewImpl->page()->selectClosestWord(contentsPoint);
     if (!result)
         return false;
 
@@ -509,7 +509,7 @@ bool TextSelection::textSelectionDown(const IntPoint& point, bool isStartedTextS
 
 static int s_textSelectionMargin = 5;
 
-void TextSelection::textSelectionMove(const IntPoint& point, bool isStartedTextSelectionFromOutside)
+void TextSelection::textSelectionMove(const IntPoint& point)
 {
     // text selection should be ignored when longtap on handle from osp
     if (!isEnabled() && isTextSelectionHandleDowned())
@@ -571,12 +571,12 @@ void TextSelection::textSelectionMove(const IntPoint& point, bool isStartedTextS
 
         if (!scrolledX && !scrolledY) {
             viewPoint = m_viewImpl->transformFromScene().mapPoint(updatedPoint);
-            m_viewImpl->page()->selectClosestWord(viewPoint, isStartedTextSelectionFromOutside);
+            m_viewImpl->page()->selectClosestWord(viewPoint);
             updateMagnifier(updatedPoint);
         }
     } else {
         viewPoint = m_viewImpl->transformFromScene().mapPoint(point);
-        m_viewImpl->page()->selectClosestWord(viewPoint, isStartedTextSelectionFromOutside);
+        m_viewImpl->page()->selectClosestWord(viewPoint);
         updateMagnifier(point);
     }
     showMagnifier();
index fa3802b..2337a7c 100644 (file)
@@ -63,8 +63,8 @@ public:
     void updateHandlesAndContextMenu(bool isShow, bool isScrolling = false);
     bool isEnabled();
     bool isAutomaticClearEnabled();
-    bool textSelectionDown(const WebCore::IntPoint& point, bool isStartedTextSelectionFromOutside = false);
-    void textSelectionMove(const WebCore::IntPoint& point, bool isStaredTextSelectionFromOutside = false);
+    bool textSelectionDown(const WebCore::IntPoint& point);
+    void textSelectionMove(const WebCore::IntPoint& point);
     void textSelectionUp(const WebCore::IntPoint& point, bool isStaredTextSelectionFromOutside = false);
 
     // handle callback
index 0dd740b..d6c8e4c 100755 (executable)
@@ -1002,7 +1002,7 @@ public:
 #endif
 
 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
-    bool selectClosestWord(const WebCore::IntPoint&, bool isStartedTextSelectionFromOutside);
+    bool selectClosestWord(const WebCore::IntPoint&);
     bool setLeftSelection(const WebCore::IntPoint&);
     bool setRightSelection(const WebCore::IntPoint&);
     bool getSelectionHandlers(WebCore::IntRect& leftRect, WebCore::IntRect& rightRect);
index 0507d75..32bd9f1 100755 (executable)
@@ -875,13 +875,13 @@ void WebPageProxy::startOfflinePageSave(String subresourceFolderName)
 #endif
 
 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
-bool WebPageProxy::selectClosestWord(const IntPoint& point, bool isStartedTextSelectionFromOutside)
+bool WebPageProxy::selectClosestWord(const IntPoint& point)
 {
     if (!isValid())
         return false;
 
     bool result = false;
-    process()->sendSync(Messages::WebPage::SelectClosestWord(point, isStartedTextSelectionFromOutside), Messages::WebPage::SelectClosestWord::Reply(result), m_pageID);
+    process()->sendSync(Messages::WebPage::SelectClosestWord(point), Messages::WebPage::SelectClosestWord::Reply(result), m_pageID);
     return result;
 }
 
index fed3ddc..621ac80 100755 (executable)
@@ -336,7 +336,7 @@ public:
     // FIXME: We could genericize these into a DrawingArea client interface. Would that be beneficial?
     void drawRect(WebCore::GraphicsContext&, const WebCore::IntRect&);
 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
-    void selectClosestWord(const WebCore::IntPoint&, bool isStartedTextSelectionFromOutside, bool& result);
+    void selectClosestWord(const WebCore::IntPoint&, bool& result);
     void setLeftSelection(const WebCore::IntPoint&, bool& result);
     void setRightSelection(const WebCore::IntPoint&, bool& result);
     void getSelectionHandlers(WebCore::IntRect& leftRect, WebCore::IntRect& rightRect);
index 265ee2f..d815d43 100755 (executable)
@@ -378,7 +378,7 @@ messages -> WebPage {
 #endif
 
 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
-    SelectClosestWord(WebCore::IntPoint point, bool isStartedTextSelectionFromOutside) -> (bool result)
+    SelectClosestWord(WebCore::IntPoint point) -> (bool result)
     SetLeftSelection(WebCore::IntPoint point) -> (bool result)
     SetRightSelection(WebCore::IntPoint point) -> (bool result)
     GetSelectionHandlers() -> (WebCore::IntRect leftRect, WebCore::IntRect rightRect)
index 5fc9faf..9e7c10d 100755 (executable)
@@ -1226,7 +1226,7 @@ void WebPage::startOfflinePageSave(String subresourceFolderName)
 #endif
 
 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
-void WebPage::selectClosestWord(const IntPoint& point, bool isStartedTextSelectionFromOutside, bool& result)
+void WebPage::selectClosestWord(const IntPoint& point, bool& result)
 {
     result = false;
 
@@ -1277,18 +1277,16 @@ void WebPage::selectClosestWord(const IntPoint& point, bool isStartedTextSelecti
     }
 #endif
 
-    if (!isStartedTextSelectionFromOutside) {
-        for (Node* node = hitTestResult.innerNonSharedNode(); node; node = node->parentNode()) {
-            if (node->isFocusable()) {
-                // Text selection shoud not be started when text of <button> tag is selected.
-                if (node->hasTagName(HTMLNames::buttonTag))
-                    return;
+    for (Node* node = hitTestResult.innerNonSharedNode(); node; node = node->parentNode()) {
+        if (node->isFocusable()) {
+            // Text selection shoud not be started when text of <button> tag is selected.
+            if (node->hasTagName(HTMLNames::buttonTag))
+                return;
 
-                if (inputElement && inputElement->isTextButton())
-                    return;
+            if (inputElement && inputElement->isTextButton())
+                return;
 
-                break;
-            }
+            break;
         }
     }