[Webkit-unassigned] [Bug 99438] [WK2][WTR] Text input controller needs selectedRange implementation

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 26 03:43:16 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=99438


Jussi Kukkonen (jku) <jussi.kukkonen at intel.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jussi.kukkonen at intel.com




--- Comment #6 from Jussi Kukkonen (jku) <jussi.kukkonen at intel.com>  2012-10-26 03:44:25 PST ---
(In reply to comment #5)
> > > Source/WebKit2/WebProcess/WebPage/WebPage.cpp:3314
> > > +bool WebPage::selectedRangeForTesting(int* start, int* length)
> > 
> > Is there a reason for not just moving WebPage::getSelectedRange() from WebPageMac.mm to here?
> 
> I'm afraid of NSRange usage in Mac port. There failure is marked as location = NSNotFound

There's only one user for this function:
  WKView selectedRange
so assuming you modified getSelectedRange to return a boolean like your new function and not set NSNotFound, wouldn't something like this work?

diff --git a/Source/WebKit2/UIProcess/API/mac/WKView.mm b/Source/WebKit2/UIProcess/API/mac/WKView.mm
index 0f221c6..d0fda59 100644
--- a/Source/WebKit2/UIProcess/API/mac/WKView.mm
+++ b/Source/WebKit2/UIProcess/API/mac/WKView.mm
@@ -1427 +1427,2 @@ static const short kIOHIDEventTypeScroll = 6;
-    _data->_page->getSelectedRange(selectionStart, selectionLength);
+    if (!_data->_page->getSelectedRange(selectionStart, selectionLength))
+        selectionStart = NSNotFound;

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list