<?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>13664</bug_id>
          
          <creation_ts>2007-05-10 14:55:18 -0700</creation_ts>
          <short_desc>REGRESSION: Extra letter in Webkit/Spell Catcher Shorthand (abbreviation) expansion</short_desc>
          <delta_ts>2007-08-08 17:03:37 -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>523.x (Safari 3)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar, Regression</keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>14457</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Chester Wong">chetgw</reporter>
          <assigned_to name="Oliver Hunt">oliver</assigned_to>
          <cc>adele</cc>
    
    <cc>ap</cc>
    
    <cc>chetgw</cc>
    
    <cc>evan</cc>
    
    <cc>justin.garcia</cc>
    
    <cc>oliver</cc>
    
    <cc>rob</cc>
    
    <cc>ruben</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>10390</commentid>
    <comment_count>0</comment_count>
    <who name="Chester Wong">chetgw</who>
    <bug_when>2007-05-10 14:55:18 -0700</bug_when>
    <thetext>When composing a message in Gmail with Safari/Webkit or Mailplane (beta), typing a Spell Catcher abbreviation causes the first letter of the abbreviation to be appended to the expansion.  E.g. if I type “btw“ it gets expanded to “bBy the way”. This does not happen in Camino nor in any word processor/text editor that I have tried.

Chet

Safari 2.0.4; Spell Catcher 10.2.3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10145</commentid>
    <comment_count>1</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-05-12 22:32:06 -0700</bug_when>
    <thetext>Chet, does this still happen with a WebKit Nightly build?  http://nightly.webkit.org/

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10129</commentid>
    <comment_count>2</comment_count>
    <who name="Evan Gross">evan</who>
    <bug_when>2007-05-12 22:52:50 -0700</bug_when>
    <thetext>(In reply to comment #0)
&gt; When composing a message in Gmail with Safari/Webkit or Mailplane (beta),
&gt; typing a Spell Catcher abbreviation causes the first letter of the abbreviation
&gt; to be appended to the expansion.  E.g. if I type “btw“ it gets expanded to “bBy
&gt; the way”. This does not happen in Camino nor in any word processor/text editor
&gt; that I have tried.
&gt; 
&gt; Chet
&gt; 
&gt; Safari 2.0.4; Spell Catcher 10.2.3
&gt; 

Hi folks, been a while since I&apos;ve last looked at the state of text input with WebKit...

First off, tell me whether the Spell Catcher preference (Interactive pane, Typing tab) to &quot;Make replacements directly (without backspacing) where possible&quot; is selected (for Safari if you have it in the Applications drawer) or not.

This preference exists specifically to work-around bug 4681.

Figuring out exactly what&apos;s wrong depends largely on whether this preference is selected. It may also be nice to know what happens when you change that preference...
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10091</commentid>
    <comment_count>3</comment_count>
    <who name="Chester Wong">chetgw</who>
    <bug_when>2007-05-13 08:30:57 -0700</bug_when>
    <thetext>RE: Comment 1

Yes, I have used nightly builds 20057, 20814, &amp; 21240; all with the same result.

RE: Comment 2

Checking the &quot;Make replacements directly (without backspacing) where
possible&quot; causes the abbreviation to remain, followed by a space and the expansion such as below:

btw By the way,

Chet
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10009</commentid>
    <comment_count>4</comment_count>
    <who name="Evan Gross">evan</who>
    <bug_when>2007-05-14 18:14:46 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; 
&gt; Checking the &quot;Make replacements directly (without backspacing) where
&gt; possible&quot; causes the abbreviation to remain, followed by a space and the
&gt; expansion such as below:
&gt; 
&gt; btw By the way,
&gt; 

OK, that behavior isn&apos;t one I&apos;ve seen before - at least not with the WebKit builds I was testing with way back when.

Can you try a couple things for me? Select the &quot;Prevent double spaces&quot; in Spell Catcher Preferences, Interactive, Automatic tab. Tell me whether the 2nd..nth space after typing a space are suppressed or not (and whether all or just some are suppressed or &quot;allowed&quot; through.

Might also be useful to know whether the &quot;Suppress separator&quot; option for individual shorthands (checkbox is below the expansion area in the Shorthand editor window) works or not.

Also see whether typing a tab instead of space as the separator behaves any differently.

If WebKit isn&apos;t properly suppressing characters, that is a very serious (and new to me) bug that needs to be filed (and fixed!) ASAP. The consequences of this sort of &quot;not suppressing characters when an input method want them suppressed are severe...

Evan
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10002</commentid>
    <comment_count>5</comment_count>
    <who name="Chester Wong">chetgw</who>
    <bug_when>2007-05-14 20:41:20 -0700</bug_when>
    <thetext>(In reply to comment #4)
l. “Prevent double spaces” has no effect; i.e. typing two or three spaces after a word leaves two or three spaces in the text.

2. &quot;Suppress separator&quot; works as expected but again, the first letter of the abbreviation is left in place.

3. “typing a tab instead of a space” causes some really bizarre things to happen. The first time I tried it, the abbreviation stayed in place but the expansion ended up in the Google Search box at the top of the window!??! I abandoned that draft and opened a new one. This time the abbreviation remained in place but with no expansion and the TAB caused the cursor to flip to the Google Search box. Subsequent attempts to duplicate the results of the first time TAB was used as the separator just caused the cursor to end up in the Google Search box without the expansion.

Mailplane has a preference item to ”Enable rich text editing by using Webkit nightly”. When this item is unchecked (disabled), all is well with the only problem that remains being that of using TAB as the separator. In this case, the expansion is fine but the cursor is still placed in the Google Search box.

Chet</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>9813</commentid>
    <comment_count>6</comment_count>
    <who name="Evan Gross">evan</who>
    <bug_when>2007-05-16 15:48:29 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; (In reply to comment #4)
&gt; l. “Prevent double spaces” has no effect; i.e. typing two or three spaces after
&gt; a word leaves two or three spaces in the text.
&gt; 
&gt; 2. &quot;Suppress separator&quot; works as expected but again, the first letter of the
&gt; abbreviation is left in place.
&gt; 
&gt; 3. “typing a tab instead of a space” causes some really bizarre things to
&gt; happen. The first time I tried it, the abbreviation stayed in place but the
&gt; expansion ended up in the Google Search box at the top of the window!??! I
&gt; abandoned that draft and opened a new one. This time the abbreviation remained
&gt; in place but with no expansion and the TAB caused the cursor to flip to the
&gt; Google Search box. Subsequent attempts to duplicate the results of the first
&gt; time TAB was used as the separator just caused the cursor to end up in the
&gt; Google Search box without the expansion.
&gt; 
&gt; Mailplane has a preference item to ”Enable rich text editing by using Webkit
&gt; nightly”. When this item is unchecked (disabled), all is well with the only
&gt; problem that remains being that of using TAB as the separator. In this case,
&gt; the expansion is fine but the cursor is still placed in the Google Search box.
&gt; 
&gt; Chet
&gt; 

OK, well, this seems to confirm my guess that keystrokes are not being suppressed when an input method &quot;says&quot; they should be.

This is a very, very bad thing.

Since it&apos;s so nasty, I&apos;ll try to find time in the next week to build the latest WebKit and actually do some real testing to confirm this and see if I can find a solution. Unless someone else wants to...

Thanks for helping with this, as it absolutely must be fixed or input methods simply aren&apos;t going to work properly at all.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>9692</commentid>
    <comment_count>7</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-05-17 08:17:05 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; OK, well, this seems to confirm my guess that keystrokes are not being
&gt; suppressed when an input method &quot;says&quot; they should be.
&gt; 
&gt; This is a very, very bad thing.

Could you write a small HTML test case demonstrating the incorrect behavior?  That would be most helpful.

&gt; Since it&apos;s so nasty, I&apos;ll try to find time in the next week to build the latest
&gt; WebKit and actually do some real testing to confirm this and see if I can find
&gt; a solution. Unless someone else wants to...

Actually, you may download nightly WebKit builds here:  http://nightly.webkit.org/.  Simply download the DMG, mount it, and double-click on the gold Safari icon to test.

&gt; Thanks for helping with this, as it absolutely must be fixed or input methods
&gt; simply aren&apos;t going to work properly at all.

A working test case attached to this bug will be the fastest path (other than writing a patch yourself!) to getting this bug fixed.  Thanks!

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>9426</commentid>
    <comment_count>8</comment_count>
    <who name="Evan Gross">evan</who>
    <bug_when>2007-05-22 11:58:00 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; Could you write a small HTML test case demonstrating the incorrect behavior? 
&gt; That would be most helpful.
&gt; 

This is often easier said than done wrt text input-related problems...

&gt; Actually, you may download nightly WebKit builds here: 
&gt; http://nightly.webkit.org/.  Simply download the DMG, mount it, and
&gt; double-click on the gold Safari icon to test.
&gt; 

I really needed to see the source to at least begin to figure out what&apos;s going on (which I&apos;ve done, but now have various questions about).

&gt; A working test case attached to this bug will be the fastest path (other than
&gt; writing a patch yourself!) to getting this bug fixed.  Thanks!
&gt; 

I probably can&apos;t write it myself without some help - so Help!

- OK, looking at the source, I some questions/comments:

1. There is a comment in -insertText:

        // insertText can be called from an input method or from normal key event processing
        // If its from normal key event processing, we may need to save the action to perform it later.
        // If its from an input method, then we should go ahead and insert the text now.  
        // We assume it&apos;s from the input method if we have marked text.
        // FIXME: In theory, this could be wrong for some input methods, so we should try to find
        // another way to determine if the call is from the input method

The FIXME note is absolutely accurate, so this code must be FIXME&apos;d. Testing for marked text is not sufficient.

2. I need to understand the meaning of WebHTMLViewInterpretKeyEventsParameters. What it contains, why it&apos;s there, what it&apos;s supposed to be used for.

3. I&apos;m not certain what the idea behind the two different code paths for &quot;isFromInputMethod&quot;/&quot;shouldSaveCommand&quot; etc. This is new since I worked on this stuff way back when, so I&apos;m not familiar with why this was implemented.

4. It looks like the shouldSaveCommand flag is related to either UpdateActiveInputArea calls and/or the input method returning whether or not it actually handled an event. Anyone know what this is all about?

Not entirely related, but still relevant, this comment:

    // We don&apos;t support inserting an attributed string but input methods don&apos;t appear to require this.

will be incorrect in the future. AttributedStrings MUST be supported here.

I have made some changes that fix this particular problem with Spell Catcher, but without knowing exactly what&apos;s going on (answers to the above questions, at minimum) have no idea if they will break other input methods...

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7511</commentid>
    <comment_count>9</comment_count>
    <who name="Robert Whyte">rob</who>
    <bug_when>2007-06-14 15:38:39 -0700</bug_when>
    <thetext>Please forward my support for your efforts to get this bug fixed. I rely on Spell Catcher&apos;s short hands for most of my work. To me it is a mission critical app. I installed Safari 3 and it has some features that are so compelling I don&apos;t want to uninstall it. Most of all, the ability to resize text entry fields on the fly. 

I experience the same problems in Mail as have been described in detail in http://bugs.webkit.org/show_bug.cgi?id=13664 

I get the sense from this thread, that the bug in web kit will be fixed but that it is hard, and may take some time. 

I will vote for the bug to be fixed. 

Good luck. 

My example is below: the letters &quot;siggg&quot; are the text of my shorthand which should be suppressed. So therefore it is a problem here in Safari as well as mail. 

siggg Robert Whyte
Director, Web Development
ToadShow Pty Ltd
e rob@toadshow.com.au
p 07 3004 7900
f 07 3846 1220
m 0409 055 325
w http://www.toadshow.com.au/

If for any reason your email doesn&apos;t get 
through to me, try rob04@toadshow.com.au

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6636</commentid>
    <comment_count>10</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2007-06-23 00:08:00 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; OK, well, this seems to confirm my guess that keystrokes are not being
&gt; suppressed when an input method &quot;says&quot; they should be.
&gt; 
&gt; This is a very, very bad thing.

I think this is a known bug that&apos;s indeed affecting other input methods, and that is being investigated.

Marking as a regression, since Spell Catcher shorthands seem to work fine in shipping Safari (for both AppKit-based text inputs and contenteditable HTML).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6591</commentid>
    <comment_count>11</comment_count>
    <who name="Rocke Woelk">rwoelk</who>
    <bug_when>2007-06-23 07:13:17 -0700</bug_when>
    <thetext>Please fix webkit to address address SpellCatcher&apos;s input issues as outlined here. SpellCatcher is mission critical for so many of us who write for a living. If not fixed in a timely manner, this could be a deal breaker in staying within Apple&apos;s platform. </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6560</commentid>
    <comment_count>12</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-06-23 11:41:09 -0700</bug_when>
    <thetext>&lt;rdar://problem/5290113&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5838</commentid>
    <comment_count>13</comment_count>
    <who name="Albert J. Menkveld">albertjmenkveld</who>
    <bug_when>2007-06-30 12:15:41 -0700</bug_when>
    <thetext>Please fix this issue, as I do currently not use  Apple Safari 3.0, because of this issue. 

-Albert</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5835</commentid>
    <comment_count>14</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2007-06-30 14:06:40 -0700</bug_when>
    <thetext>It seems that Oliver&apos;s patch didn&apos;t fix this problem - I can still reproduce it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5831</commentid>
    <comment_count>15</comment_count>
    <who name="Evan Gross">evan</who>
    <bug_when>2007-06-30 14:31:23 -0700</bug_when>
    <thetext>(In reply to comment #14)
&gt; It seems that Oliver&apos;s patch didn&apos;t fix this problem - I can still reproduce
&gt; it.
&gt; 

What/where&apos;s the patch?

I have figured out a way to get this working with Spell Catcher, but due to my lack of knowledge about the various private parameters (WebHTMLViewInterpretKeyEventsParameters ) being passed around (-insertText, -doCommandBySelector), I have no idea whether it&apos;s going to break other input methods.

In any case, it looks to me like the value of shouldSaveCommand is the key to figure out whether the text/command is the result of an UpdateActiveInputArea event. AND it looks like it&apos;s currently being used incorrectly. And checking whether there&apos;s marked text or not to decide whether the event is from an input method is just plain wrong. Input methods can send text via UAIA without maintaining an active input area at all.

I&apos;m hesitant to post a patch without knowing more about the reasoning behind the changes that have been made since I last looked at this stuff. But if you want me to post what I&apos;ve got, I certainly can.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5825</commentid>
    <comment_count>16</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2007-06-30 17:32:59 -0700</bug_when>
    <thetext>*** Bug 4681 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5826</commentid>
    <comment_count>17</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2007-06-30 17:36:08 -0700</bug_when>
    <thetext>Evan, we were doing substantial work to fix issues with international text support, i guess ap thought these would help.  Unfortunately the symptoms experienced by SpellChecker are unrelated to our International text support problems.

Looking at this, you&apos;re right it is just the return of 4681.  Technically i should dup this to that, but there&apos;s more discussion (and a radar) associated with this so am marking 4681 as a dupe of this.

I wish there was some documentation of these &quot;secret&quot; attributes :-/

It looks like we should be able to do something similar to the replacement of marked text, in this case, but it still irritates me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5807</commentid>
    <comment_count>18</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2007-06-30 22:17:40 -0700</bug_when>
    <thetext>Evan do you esxpect the space character to be inserted before or after your inputmethod logic occurs?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5808</commentid>
    <comment_count>19</comment_count>
    <who name="Evan Gross">evan</who>
    <bug_when>2007-06-30 23:41:18 -0700</bug_when>
    <thetext>(In reply to comment #18)
&gt; Evan do you esxpect the space character to be inserted before or after your
&gt; inputmethod logic occurs?
&gt; 

This is what Spell Catcher does when expanding a shorthand abbreviation - as an example say that typing &quot;fyi&quot; should result in &quot;for your information&quot;:

1. In an application that does NOT support TSM document access and the required sendRange parameter to the UpdateActiveInputArea event (the current state of WebHTMLView, as it doesn&apos;t support the NSTextInputReplacementRangeAttributeName attribute):

- user types f, then y, then i, then a whitespace or newline separator (we&apos;ll say it&apos;s a space for illustrative purposes).

- Spell Catcher checks the &quot;fyi&quot; when it receives the space typed afterwards, and finds the expansion &quot;for your information&quot;.

- After determining it&apos;s an abbreviation that needs to be expanded, Spell Catcher SUPPRESSES the space by returning to TSM that it has handled the event in its entirety. THIS IS WHERE WebView is screwing up. No UpdateActiveInputArea event has been sent (yet), the input method is simply returning a non-zero ComponentResult from its Event dispatch call, which MUST be respected by the application. Somehow the event is still getting through, even though TSM has been told that it was handled, and therefore should NOT be handed off to the client app.

- Spell Catcher calculates how many backspace characters need to be posted to backspace over the &quot;fyi&quot; that was typed. REMEMBER, since the space character has been suppressed (normally, in a properly functioning app) only 3 backspaces need to be posted. Backspace and other control characters are handled very differently in Cocoa apps vs. (most) Carbon apps if sent via an UAIA call. We don&apos;t want ASCII 8 inserted into the document&apos;s text (tab characters pose a particular problem here, but I digress). so we post them with the CGRemote APIs. They need to be handled by the app as physical keystrokes.
=====THIS IS WHY the first letter of the abbreviation is &quot;left behind&quot; - take a look at the original problem reports=====

- NOW, in an app that supports inline input via UpdateActiveInputArea (WebView does at least support this), the expansion &quot;for your information &quot; is sent to the application via an UpdateActiveInputArea call, specifying that all the text should be dumped immediately - no inline area (marked text) should result. This a prime example of text coming from an input method, and there is NO marked text in the document before or afterward.
+++ ALSO NOTE CAREFULLY that the suppressed space following the f y i that was typed, is appended to the expansion - there are a number of important reasons it&apos;s done this way, no need to get into that aspect now, though.

So the basic problem stems from the fact that &quot;input method-handled&quot; events are still getting through to and processed by WebView. If an input method wants an event suppressed, the app must obey or really nothing is going to work properly from that point on. This is the basis of many Spell Catcher features - preventing double spaces, turning straight quotes into curly quotes, automatic capitalization changes (in certain circumstances). This is all broken because of this bug, and it&apos;s something that can absolutely not be worked-around at the input method level.

The TSM Doc Access-aware situation is far more optimal, as Spell Catcher can avoid backspacing entirely. It just replaces the &quot;fyi &quot; directly in the text with &quot;for your information &quot;. No fuss, no muss, instantaneous. That&apos;s why NSTextInputReplacementRangeAttributeName should be supported, but supporting it has absolutely no relevance or relation to fixing this particular problem. I don&apos;t think this bug and Bug 4681 are really duplicates. But they are in the same very basic text input handling arena, and both need to be fixed. Fix this one first, then optimize by supporting NSTextInputReplacementRangeAttributeName. Supporting NSTextInputReplacementRangeAttributeName without fixing this may get Spell Catcher to work right, but other input methods that don&apos;t look for doc access support in order to perform better will still have this not-suppressing-the-character-I-told-you-to-suppress issues.

Phew!
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5785</commentid>
    <comment_count>20</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2007-07-01 15:25:26 -0700</bug_when>
    <thetext>The problem i&apos;ve encountered is that (afaict) is when handling the replacement i end up with
&quot;fyi &quot; =&gt; &quot;fFor your information &quot;

If you are actually inserting the space i&apos;m guessing that we aren&apos;t correctly detecting that you have consumed the space.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5782</commentid>
    <comment_count>21</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2007-07-01 15:36:26 -0700</bug_when>
    <thetext>Hmmm, something i&apos;ve thought i needed to do is treat all key events as being consumed by the IM even if there isn&apos;t a marked region.

This fixes the problem, but may have a substantial impact on non-IM based input so will require substantial testing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5766</commentid>
    <comment_count>22</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2007-07-01 18:02:07 -0700</bug_when>
    <thetext>Righto, there are two bugs involved, one, the fact they we aren&apos;t handling NSTextInputReplacementRangeAttributeName in insertText:

The other is bug 14457 which is what causes the first character of the autocorrect trigger to remain after the autocorrect</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5753</commentid>
    <comment_count>23</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2007-07-01 22:27:25 -0700</bug_when>
    <thetext>Righto, 14457 should be fixed, which means the backspace route should work.

We now need to make the replacement range work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5756</commentid>
    <comment_count>24</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2007-07-01 22:28:47 -0700</bug_when>
    <thetext>*** Bug 4681 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5757</commentid>
    <comment_count>25</comment_count>
      <attachid>15343</attachid>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2007-07-01 23:37:33 -0700</bug_when>
    <thetext>Created attachment 15343
First run at fixing it

First run at fixing this problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5758</commentid>
    <comment_count>26</comment_count>
      <attachid>15343</attachid>
    <who name="Justin Garcia">justin.garcia</who>
    <bug_when>2007-07-01 23:46:29 -0700</bug_when>
    <thetext>Comment on attachment 15343
First run at fixing it

     // We don&apos;t support inserting an attributed string but input methods don&apos;t appear to require this.

Might want to remove this comment.

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5759</commentid>
    <comment_count>27</comment_count>
    <who name="Justin Garcia">justin.garcia</who>
    <bug_when>2007-07-01 23:48:11 -0700</bug_when>
    <thetext>(In reply to comment #26)
&gt; Might want to remove this comment.

Oops nevermind.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5760</commentid>
    <comment_count>28</comment_count>
      <attachid>15344</attachid>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2007-07-02 00:00:24 -0700</bug_when>
    <thetext>Created attachment 15344
Minor update

Whoops, if we get a replacement range we must not be getting &quot;real&quot; keyboard events, so assume it&apos;s from an IM.

What i would give to be able to have regression tests for IMs, but don&apos;t have time to be able to do the work necessary to get such a system in place.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5744</commentid>
    <comment_count>29</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2007-07-02 00:43:36 -0700</bug_when>
    <thetext>Landed r23926</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5586</commentid>
    <comment_count>30</comment_count>
    <who name="Evan Gross">evan</who>
    <bug_when>2007-07-04 14:49:50 -0700</bug_when>
    <thetext>(In reply to comment #28)
&gt; Created an attachment (id=15344) [edit]
&gt; Minor update
&gt; 
&gt; Whoops, if we get a replacement range we must not be getting &quot;real&quot; keyboard
&gt; events, so assume it&apos;s from an IM.
&gt; 
&gt; What i would give to be able to have regression tests for IMs, but don&apos;t have
&gt; time to be able to do the work necessary to get such a system in place.
&gt; 

Thanks Oliver! After some testing all seems *almost* perfect. There is an issue with the handling of the replacement range parameter, in that the selection is changed afterwards. This is a definite problem (NSTextView, MLTE, WASTE and BBEdit all maintain the selection properly), as is cannot be assumed that the replacement range is always at the insertion point (and indeed, there may be a selection not just an insertion point).

Should I file a separate bug?

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5509</commentid>
    <comment_count>31</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2007-07-05 12:30:31 -0700</bug_when>
    <thetext>Yes, file a separate bug.  I assume this will cause the scrolling problem you referred to in #4681 and possibly an unwanted selection event will be fired -- this possibly hits the marked text path as well.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4807</commentid>
    <comment_count>32</comment_count>
    <who name="Jon Fink">js.fink</who>
    <bug_when>2007-07-14 03:01:41 -0700</bug_when>
    <thetext>This is not resolved/fixed. The problem persists in the latest Safari 3.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4810</commentid>
    <comment_count>33</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2007-07-14 05:28:13 -0700</bug_when>
    <thetext>Please use a nightly build from &lt;http://nightly.webkit.org&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4757</commentid>
    <comment_count>34</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2007-07-14 15:09:33 -0700</bug_when>
    <thetext>Jon, this fix has not been released in a release version of webkit yet, you&apos;ll need to test against a nightly -- see http://nightly.webkit.org</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3700</commentid>
    <comment_count>35</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-07-25 22:25:51 -0700</bug_when>
    <thetext>(In reply to comment #32)
&gt; This is not resolved/fixed. The problem persists in the latest Safari 3.

Jon, please test this with a recent WebKit nightly and report back the results here.  Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2859</commentid>
    <comment_count>36</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-08-07 21:30:35 -0700</bug_when>
    <thetext>Could someone please verify that this issue is fixed with WebKit Nightly r23926 or later?  Thanks!

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2851</commentid>
    <comment_count>37</comment_count>
    <who name="Chester Wong">chetgw</who>
    <bug_when>2007-08-07 22:07:41 -0700</bug_when>
    <thetext>(In reply to comment #36)
&gt; Could someone please verify that this issue is fixed with WebKit Nightly r23926
&gt; or later?  Thanks!
&gt; 
Sorry, I’ve been delinquent on this matter. Webkit r24260 works in Mailplane beta. I have not tried in Mail.app nor Safari 3.0 beta.

Chet
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2792</commentid>
    <comment_count>38</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-08-08 17:03:37 -0700</bug_when>
    <thetext>(In reply to comment #37)
&gt; Sorry, I’ve been delinquent on this matter. Webkit r24260 works in Mailplane
&gt; beta. I have not tried in Mail.app nor Safari 3.0 beta.

Thanks!!

</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>15343</attachid>
            <date>2007-07-01 23:37:33 -0700</date>
            <delta_ts>2007-07-02 00:00:24 -0700</delta_ts>
            <desc>First run at fixing it</desc>
            <filename>insertTextReplace.patch</filename>
            <type>text/plain</type>
            <size>2151</size>
            <attacher name="Oliver Hunt">oliver</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYktpdC9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT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4gVFNNLiAgVGhpcyBiZWhhdmlvdXIgbWF0Y2hlcyB0aGF0
IG9mIC1bV2ViSFRNTFZpZXcgc2V0TWFya2VkVGV4dDpzZWxlY3RlZFJhbmdlOl0gd2hlbiBpdCBy
ZWNlaXZlcyBhbgorICAgICAgICAvLyBOU0F0dHJpYnV0ZWRTdHJpbmcKKyAgICAgICAgTlNTdHJp
bmcgKnJhbmdlU3RyaW5nID0gW3N0cmluZyBhdHRyaWJ1dGU6TlNUZXh0SW5wdXRSZXBsYWNlbWVu
dFJhbmdlQXR0cmlidXRlTmFtZSBhdEluZGV4OjAgbG9uZ2VzdEVmZmVjdGl2ZVJhbmdlOk5VTEwg
aW5SYW5nZTpOU01ha2VSYW5nZSgwLCBbdGV4dCBsZW5ndGhdKV07CisgICAgICAgIGlmIChyYW5n
ZVN0cmluZykgCisgICAgICAgICAgICBbW3NlbGYgX2JyaWRnZV0gc2VsZWN0TlNSYW5nZTpOU1Jh
bmdlRnJvbVN0cmluZyhyYW5nZVN0cmluZyldOworICAgIH0gZWxzZQogICAgICAgICB0ZXh0ID0g
c3RyaW5nOwogCiAgICAgYm9vbCBldmVudEhhbmRsZWQgPSBmYWxzZTsK
</data>
<flag name="review"
          id="6360"
          type_id="1"
          status="+"
          setter="justin.garcia"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>15344</attachid>
            <date>2007-07-02 00:00:24 -0700</date>
            <delta_ts>2007-07-02 00:29:22 -0700</delta_ts>
            <desc>Minor update</desc>
            <filename>insertTextReplace.patch</filename>
            <type>text/plain</type>
            <size>2755</size>
            <attacher name="Oliver Hunt">oliver</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYktpdC9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gV2ViS2l0L0NoYW5nZUxvZwko
cmV2aXNpb24gMjM5MjUpCisrKyB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ZXJzLT5zaG91bGRTYXZlQ29tbWFuZDsKLSAg
ICAgICAgYm9vbCBpc0Zyb21JbnB1dE1ldGhvZCA9IFtzZWxmIGhhc01hcmtlZFRleHRdOwogICAg
ICAgICBpZiAoZXZlbnQgJiYgc2hvdWxkU2F2ZUNvbW1hbmQgJiYgIWlzRnJvbUlucHV0TWV0aG9k
KSB7CiAgICAgICAgICAgICBLZXlwcmVzc0NvbW1hbmQgY29tbWFuZDsKICAgICAgICAgICAgIGNv
bW1hbmQudGV4dCA9IHRleHQ7Cg==
</data>
<flag name="review"
          id="6361"
          type_id="1"
          status="+"
          setter="justin.garcia"
    />
          </attachment>
      

    </bug>

</bugzilla>