Fix for the issue "context menu is not shown on selecting selectall on contextmenu"
authorbhargavi.k <bhargavi.k@samsung.com>
Fri, 30 Aug 2013 13:07:41 +0000 (18:37 +0530)
committerTaeyun An <ty.an@samsung.com>
Thu, 10 Oct 2013 07:51:27 +0000 (16:51 +0900)
[Title]  Fix for the issue context menu is not shown on selecting selectall on contextmenu
[Issue#] Web-3918
[Problem] Context menu is not displaying
[Cause]  Lectrect handler was not properly checked with Viewport rect
         If LeftRect's handler x & y position is in border of viewport maxX and maxY position, this was not handled.
[Solution] Made proper check for leftRect handlers wrt ViewRect.

Change-Id: Ibc1c528d6be838a7dc68f63b87ee396370fd3397

Source/WebKit2/UIProcess/API/efl/tizen/TextSelection.cpp

index 8fa0d9d..3db92b1 100755 (executable)
@@ -322,12 +322,16 @@ void TextSelection::showContextMenu()
             // First check That the modified points are present in view port
             point = visiblePoint;
             isPresentInViewPort = true;
-        } else if (viewportRect.contains(leftRect.location())) {
+        } else if ((leftRect.x() >= viewportRect.x() && leftRect.x() <= viewportRect.maxX()) && (leftRect.y() >= viewportRect.y() && leftRect.y() <= viewportRect.maxY())) {
+            // This condition will handle the case if leftRect.x()  == viewportRect.maxX().
+            // So there are might some content that where leftRect.maxX > viewportRect.maxX().
             // else if the calculated point is not in the view port area the
             // draw context menu at left point if visible
             point = leftRect.location();
             isPresentInViewPort = true;
-        } else if (viewportRect.contains(rightRect.maxXMinYCorner())) {
+        } else if ((rightRect.x() >= viewportRect.x() && rightRect.x() <= viewportRect.maxX()) && (rightRect.y() >= viewportRect.y() && rightRect.y() <= viewportRect.maxY())) {
+            // This condition will handle the case if rightRect.x()  == viewportRect.maxX().
+            // So there are might some content that where rightRect.maxX > viewportRect.maxX().
             // else if the calculated point is not in the view port area the
             // draw context menu at right point if visible
             point = rightRect.maxXMinYCorner();