Selection mode on images is not working
authorprathmesh.m <prathmesh.m@samsung.com>
Mon, 8 Jul 2013 13:32:42 +0000 (19:02 +0530)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Thu, 25 Jul 2013 06:21:40 +0000 (06:21 +0000)
[Title] Selection mode on images is not working
[Issue#] WEB-3582
[Problem] Long tap on image with hyperlink and select
   selection mode, selection mode is not wokring
[Cause] In this case there is a anchor tag and image tag
   is child of anchor, but before image there is another
   tag. Using this tag we create a selection range and
   once the range is created we check if its not image and
   extent the selection. This is not correct, we must
   extend the selection even if there is image
[Solution] Removed the check to block extending seletion
   when there is image tag

Change-Id: I6db5848ea72e14cdd7ee3789af6cf4c1995d9fb8

Source/WebKit2/WebProcess/WebPage/WebPage.cpp

index f4ef35d..66333b7 100755 (executable)
@@ -1226,7 +1226,7 @@ void WebPage::selectLink(WebCore::IntPoint positionForSelection, bool& result)
             if (r && (r->isText() || r->isImage())) {
                 if (!range)
                     range = VisibleSelection::selectionFromContentsOfNode(childNode).toNormalizedRange();
-                else if (!hitTestResult.image()) {
+                else {
                     RefPtr<Range> extendedRange = VisibleSelection::selectionFromContentsOfNode(childNode).toNormalizedRange();
                     range->setEnd(childNode, extendedRange->endOffset());
                 }