[BlackBerry] Prevent text selection inside Colour and Date/Time input fields
authormifenton@rim.com <mifenton@rim.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Mar 2013 18:38:33 +0000 (18:38 +0000)
committermifenton@rim.com <mifenton@rim.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Mar 2013 18:38:33 +0000 (18:38 +0000)
https://bugs.webkit.org/show_bug.cgi?id=111733

Reviewed by Rob Buis.

PR 305194.

Skip rendering of selection if it is in a popup driven
input field.  This covers situations where EditorClientBlackBerry::shouldChangeSelectedRange
is either not called or focus is not complete when called.

Informally reviewed by Gen Mak.

* WebKitSupport/SelectionHandler.cpp:
(BlackBerry::WebKit::SelectionHandler::selectionPositionChanged):
(WebKit):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@145571 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/blackberry/ChangeLog
Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp

index e6c3e53..04264a8 100644 (file)
@@ -1,3 +1,22 @@
+2013-03-12  Mike Fenton  <mifenton@rim.com>
+
+        [BlackBerry] Prevent text selection inside Colour and Date/Time input fields
+        https://bugs.webkit.org/show_bug.cgi?id=111733
+
+        Reviewed by Rob Buis.
+
+        PR 305194.
+
+        Skip rendering of selection if it is in a popup driven
+        input field.  This covers situations where EditorClientBlackBerry::shouldChangeSelectedRange
+        is either not called or focus is not complete when called.
+
+        Informally reviewed by Gen Mak.
+
+        * WebKitSupport/SelectionHandler.cpp:
+        (BlackBerry::WebKit::SelectionHandler::selectionPositionChanged):
+        (WebKit):
+
 2013-03-12  Genevieve Mak  <gmak@rim.com>
 
         [BlackBerry] Notify client if the selection is in a subframe when started.
index 0b732db..8f7589e 100644 (file)
@@ -1150,6 +1150,13 @@ void SelectionHandler::selectionPositionChanged(bool forceUpdateWithoutChange)
     else if (!m_selectionActive)
         return;
 
+    if (Node* focusedNode = frame->document()->focusedNode()
+        && (focusedNode->hasTagName(HTMLNames::selectTag) || (focusedNode->isElementNode() && DOMSupport::isPopupInputField(toElement(focusedNode))))) {
+            SelectionLog(Platform::LogLevelInfo, "SelectionHandler::selectionPositionChanged selection is on a popup control, skipping rendering.");
+            return;
+        }
+    }
+
     SelectionTimingLog(Platform::LogLevelInfo,
         "SelectionHandler::selectionPositionChanged starting at %f",
         m_timer.elapsed());