Title: [144202] trunk/Source/WebKit/blackberry
Revision
144202
Author
[email protected]
Date
2013-02-27 09:20:15 -0800 (Wed, 27 Feb 2013)

Log Message

[BlackBerry] Context menu cannot be invoked after doing text selection in landscape mode
https://bugs.webkit.org/show_bug.cgi?id=110860

Patch by Sean Wang <[email protected]> on 2013-02-27
Reviewed by Yong Li.

PR 290248 Internally reviewed by Mike Fenton

Add a parameter to notify the webpage client which parts of selection have
changed in visual or in its selected DOM content. Refactor the selection details
parameter to platform repo.

The reason of this issue is that when _javascript_ triggers webpage layout, the selection
will update its apperance event when the selected content is not changed. We want
to hide the context menu only when the selected content is changed not when only its
visual is changed.

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/Api/WebPageClient.h (144201 => 144202)


--- trunk/Source/WebKit/blackberry/Api/WebPageClient.h	2013-02-27 17:18:13 UTC (rev 144201)
+++ trunk/Source/WebKit/blackberry/Api/WebPageClient.h	2013-02-27 17:20:15 UTC (rev 144202)
@@ -43,6 +43,7 @@
 class IntRectRegion;
 class NetworkRequest;
 class NetworkStreamFactory;
+struct SelectionDetails;
 class ViewportAccessor;
 class WebUserMediaRequest;
 
@@ -154,7 +155,7 @@
     virtual void requestSpellingCheckingOptions(imf_sp_text_t&, const BlackBerry::Platform::IntRect& documentCaretRect, const BlackBerry::Platform::IntSize& screenOffset, const bool shouldMoveDialog) = 0;
     virtual int32_t checkSpellingOfStringAsync(wchar_t* text, const unsigned length) = 0;
 
-    virtual void notifySelectionDetailsChanged(const Platform::IntRect& documentStartRect, const Platform::IntRect& documentEndRect, const Platform::IntRectRegion& documentRegion, bool overrideTouchHandling = false, BlackBerry::Platform::RequestedHandlePosition = BlackBerry::Platform::SmartPlacement) = 0;
+    virtual void notifySelectionDetailsChanged(const BlackBerry::Platform::SelectionDetails&) = 0;
     virtual void cancelSelectionVisuals() = 0;
     virtual void notifySelectionHandlesReversed() = 0;
     virtual void notifyCaretChanged(const Platform::IntRect& documentCaretRect, bool userTouchTriggered, bool isSingleLineInput = false, const Platform::IntRect& singleLineDocumentBoundingBox = Platform::IntRect(), bool textFieldIsEmpty = false) = 0;

Modified: trunk/Source/WebKit/blackberry/ChangeLog (144201 => 144202)


--- trunk/Source/WebKit/blackberry/ChangeLog	2013-02-27 17:18:13 UTC (rev 144201)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2013-02-27 17:20:15 UTC (rev 144202)
@@ -1,5 +1,31 @@
 2013-02-27  Sean Wang  <[email protected]>
 
+        [BlackBerry] Context menu cannot be invoked after doing text selection in landscape mode
+        https://bugs.webkit.org/show_bug.cgi?id=110860
+
+        Reviewed by Yong Li.
+
+        PR 290248 Internally reviewed by Mike Fenton
+
+        Add a parameter to notify the webpage client which parts of selection have
+        changed in visual or in its selected DOM content. Refactor the selection details
+        parameter to platform repo.
+
+        The reason of this issue is that when _javascript_ triggers webpage layout, the selection
+        will update its apperance event when the selected content is not changed. We want
+        to hide the context menu only when the selected content is changed not when only its
+        visual is changed.
+
+* Api/WebPageClient.h:
+        (Platform):
+        * WebKitSupport/SelectionHandler.cpp:
+        (BlackBerry::WebKit::SelectionHandler::cancelSelection):
+        (BlackBerry::WebKit::SelectionHandler::selectionPositionChanged):
+        * WebKitSupport/SelectionHandler.h:
+        (SelectionHandler):
+
+2013-02-27  Sean Wang  <[email protected]>
+
         [BlackBerry] The virtual keyboard hides part of Signing In dialog
         https://bugs.webkit.org/show_bug.cgi?id=110836
 

Modified: trunk/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp (144201 => 144202)


--- trunk/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp	2013-02-27 17:18:13 UTC (rev 144201)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp	2013-02-27 17:20:15 UTC (rev 144202)
@@ -87,8 +87,7 @@
         m_webPage->m_selectionOverlay->hide();
     // Notify client with empty selection to ensure the handles are removed if
     // rendering happened prior to processing on webkit thread
-    m_webPage->m_client->notifySelectionDetailsChanged(WebCore::IntRect(DOMSupport::InvalidPoint, WebCore::IntSize()),
-        WebCore::IntRect(DOMSupport::InvalidPoint, WebCore::IntSize()), IntRectRegion());
+    m_webPage->m_client->notifySelectionDetailsChanged(SelectionDetails());
 
     SelectionLog(Platform::LogLevelInfo, "SelectionHandler::cancelSelection");
 
@@ -1019,7 +1018,13 @@
     if (m_webPage->m_selectionOverlay)
         m_webPage->m_selectionOverlay->draw(visibleSelectionRegion);
 
-    m_webPage->m_client->notifySelectionDetailsChanged(startCaret, endCaret, visibleSelectionRegion, inputNodeOverridesTouch(), requestedSelectionHandlePosition(frame->selection()->selection()));
+
+    VisibleSelection currentSelection = frame->selection()->selection();
+    SelectionDetails details(startCaret, endCaret, visibleSelectionRegion, inputNodeOverridesTouch(),
+        m_lastSelection != currentSelection, requestedSelectionHandlePosition(frame->selection()->selection()));
+
+    m_webPage->m_client->notifySelectionDetailsChanged(details);
+    m_lastSelection = currentSelection;
     SelectionTimingLog(Platform::LogLevelInfo,
         "SelectionHandler::selectionPositionChanged completed at %f",
         m_timer.elapsed());

Modified: trunk/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.h (144201 => 144202)


--- trunk/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.h	2013-02-27 17:18:13 UTC (rev 144201)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.h	2013-02-27 17:20:15 UTC (rev 144202)
@@ -102,6 +102,7 @@
     BlackBerry::Platform::IntRectRegion m_lastSelectionRegion;
 
     BlackBerry::Platform::StopWatch m_timer;
+    WebCore::VisibleSelection m_lastSelection;
 };
 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to