<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>4699</bug_id>
          
          <creation_ts>2005-08-27 16:27:09 -0700</creation_ts>
          <short_desc>_updateSelectionForInputManager MUST ensure that input methods receive kCMFixTextService even if no marked text</short_desc>
          <delta_ts>2005-09-25 20:49:04 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>HTML Editing</component>
          <version>420+</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Evan Gross">evan</reporter>
          <assigned_to name="Dave Hyatt">hyatt</assigned_to>
          <cc>ap</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>17756</commentid>
    <comment_count>0</comment_count>
    <who name="Evan Gross">evan</who>
    <bug_when>2005-08-27 16:27:09 -0700</bug_when>
    <thetext>Input methods that do not maintain an active inline input area still need to know when the selection has 
changed. Generally this is determined by such an input method when it receives the kCMFixTextService 
component call. This call is made to TSM via -[NSInputManager markedTextAbandoned:].

Right now, _updateSelectionForInputManager test whether there is marked text, and returns 
immediately if that&apos;s the case:

- (void)_updateSelectionForInputManager
{
    if (![self hasMarkedText] || _private-&gt;ignoreMarkedTextSelectionChange)
	return;

...

This is incorrect. The above needs to be changed to eliminate the hasMarkedText test, and continue on 
to do the &quot;right thing&quot; depending on whether the selection is inside the marked text or not.

So the above needs to be changed to:

- (void)_updateSelectionForInputManager
{
    if (_private-&gt;ignoreMarkedTextSelectionChange)
	return;

and then the &quot;right thing&quot; will be done for the case when an input method doesn&apos;t maintain an active 
inline input area.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18662</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2005-09-04 09:08:17 -0700</bug_when>
    <thetext>Evan, could you please point to some documentation specifying this behavior? The documentation at 
&lt;http://developer.apple.com/documentation/Carbon/Reference/Text_Services_Manager/tsm_refchap/
chapter_1.2_section_6.html&gt; doesn&apos;t suggest such usage...

My own input method works with inline input, so I haven&apos;t researched this myself a lot.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18717</commentid>
    <comment_count>2</comment_count>
    <who name="Evan Gross">evan</who>
    <bug_when>2005-09-04 18:03:38 -0700</bug_when>
    <thetext>(In reply to comment #1)
&gt; Evan, could you please point to some documentation specifying this behavior? The documentation at 
&gt; &lt;http://developer.apple.com/documentation/Carbon/Reference/Text_Services_Manager/
tsm_refchap/
&gt; chapter_1.2_section_6.html&gt; doesn&apos;t suggest such usage...
&gt; 
&gt; My own input method works with inline input, so I haven&apos;t researched this myself a lot.

There&apos;s no actual documentation for this, probably because until my input method came along, there 
wasn&apos;t one that didn&apos;t maintain an inline input area AND needed to know when the selection in the 
document changed.

The better solution might be to make sure that mouse events in WebView get passed along to the active 
input method. This is what happens in NSTextView. Problem is, I have no idea how this is or should 
actually be done. I think it may be happening (in NSTextView&apos;s case) somewhere other than the 
NSTextInput protocol methods or even mouseDown. Probably at some lower level mortals can&apos;t &quot;get at&quot;. 
So the solution I propose here is one that&apos;s both do-able, works, and really shouldn&apos;t have any side-
effects on input methods that do inline input as well (a call to fix should just be ignored by such an 
input method when there&apos;s no inline input happening, anyway).
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19020</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2005-09-07 10:55:29 -0700</bug_when>
    <thetext>I agree, making it pass mouse events to input methods sounds like a much better solution. Here is how 
it happens in NSTextView:

#6  0x933adbd0 in TSMEventToTextService ()
#7  0x933adb44 in TSMEventToInputMethod ()
#8  0x933b4294 in TSMProcessMouseEvent ()
#9  0x9399a790 in -[NSTSMInputContext handleMouseEvent:] ()
#10 0x93758eb4 in -[NSTextView mouseDown:] ()
#11 0x9368d9c8 in -[NSWindow sendEvent:] ()
#12 0x93636bfc in -[NSApplication sendEvent:] ()
#13 0x9362e090 in -[NSApplication run] ()
#14 0x9371e8bc in NSApplicationMain ()
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19039</commentid>
    <comment_count>4</comment_count>
    <who name="Evan Gross">evan</who>
    <bug_when>2005-09-07 18:40:52 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; I agree, making it pass mouse events to input methods sounds like a much better solution. Here is 
how 
&gt; it happens in NSTextView:
&gt; 
&gt; #6  0x933adbd0 in TSMEventToTextService ()
&gt; #7  0x933adb44 in TSMEventToInputMethod ()
&gt; #8  0x933b4294 in TSMProcessMouseEvent ()
&gt; #9  0x9399a790 in -[NSTSMInputContext handleMouseEvent:] ()
&gt; #10 0x93758eb4 in -[NSTextView mouseDown:] ()
&gt; #11 0x9368d9c8 in -[NSWindow sendEvent:] ()
&gt; #12 0x93636bfc in -[NSApplication sendEvent:] ()
&gt; #13 0x9362e090 in -[NSApplication run] ()
&gt; #14 0x9371e8bc in NSApplicationMain ()
&gt; 

Sure, that&apos;s how it&apos;s done in NSTextView, but I see no way to do the same for WebView (well, unless you 
work at Apple). NSTSMInputContext isn&apos;t public (as you well know), and I have no idea if it&apos;s ok to call -
[NSTSMInputContext handleMouseEvent:] from within -[WebHTMLView mouseDown:].

So yes, -[WebHTMLView mouseDown:] is obviously not finished (there&apos;s that TEXTINPUT comment, but 
no corresponding code!), and needs to be, but how?

If you have any ideas, fire away...
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19049</commentid>
    <comment_count>5</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2005-09-07 21:56:44 -0700</bug_when>
    <thetext>Please see my comment in bug 4394.

My understanding is that if we get that bug fixed, this one becomes INVALID, right?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19050</commentid>
    <comment_count>6</comment_count>
    <who name="Evan Gross">evan</who>
    <bug_when>2005-09-07 22:07:04 -0700</bug_when>
    <thetext>(In reply to comment #5)

Theoretically, YES, fixing 4394 should take care of this issue (as well as others).

So now to figure out how to implement -[WebHTMLView(WebNSTextInputSupport) 
characterIndexForPoint:]. I really think it needs to be done, as it&apos;s probably needed elsewhere as well 
(PosToOffset??).
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20610</commentid>
    <comment_count>7</comment_count>
    <who name="Evan Gross">evan</who>
    <bug_when>2005-09-25 20:49:04 -0700</bug_when>
    <thetext>Seems a non-issue now that #4394 is fixed. At least not for my input method. I think we can pretty safely 
mark it as invalid.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>