Change the focused frame if flame has different value between focusedFrame and hitTes...
authorTaeyun An <ty.an@samsung.com>
Tue, 20 Aug 2013 13:22:55 +0000 (22:22 +0900)
committerTaeyun An <ty.an@samsung.com>
Tue, 20 Aug 2013 13:31:56 +0000 (22:31 +0900)
[Title] Change the focused frame if flame has different value between focusedFrame and hitTestResultFrame
[Issue#] N/A
[Problem] Sometimes text selection handles and context menu are not appear via longpress
[Cause] Sometimes focusedFrame and hitTestResultFrame has different value
[Solution] Change the focused frame if flame has different value between focusedFrame and hitTestResultFrame

Change-Id: Id3cbaf1764ad4f1827abe2aad5ac0256556faced

Source/WebKit2/WebProcess/WebPage/WebPage.cpp

index cefc573..9debeba 100755 (executable)
@@ -1213,6 +1213,14 @@ void WebPage::selectLink(WebCore::IntPoint positionForSelection, bool& result)
 
     HitTestResult hitTestResult = frame->eventHandler()->hitTestResultAtPoint(frameView->windowToContents(positionForSelection), false);
 
+    if (hitTestResult.innerNonSharedNode()) {
+        Frame* hitTestFrame = hitTestResult.innerNonSharedNode()->document()->frame();
+        if (frame != hitTestFrame) {
+            frame->page()->focusController()->setFocusedFrame(hitTestFrame);
+            frame = hitTestFrame;
+        }
+    }
+
     RefPtr<Range> range;
     Element* URLElement = hitTestResult.URLElement();
     if (URLElement) {