[webkit-changes] cvs commit: WebCore/khtml/editing htmlediting.cpp htmlediting.h

Adele adele at opensource.apple.com
Tue Aug 9 10:48:56 PDT 2005


adele       05/08/09 10:48:55

  Modified:    .        Tag: Safari-2-0-branch ChangeLog
               khtml/editing Tag: Safari-2-0-branch htmlediting.cpp
                        htmlediting.h
  Log:
          Merged fix from TOT to Safari-2-0-branch
  
      2005-08-04  Justin Garcia  <justin.garcia at apple.com>
  
          Reviewed by kocienda
  
          Fix for:
          - <rdar://problem/4132360> HIM-8A428:Space key works like Return key in Mail application.
          - <rdar://problem/4122708> Mail: when composing new mail with a Korean input method, the first space doesn't work
  
          If the user terminates marked text with a space, a string including marked characters and a normal,
          breaking space, is passed to WebCore in order to replace the previous marked sequence.  The fix ensures
          that the space becomes a non breaking space if necessary.
  
          Test cases added:
          * manual-tests/korean-input-space.html
  
          * khtml/editing/insert_text_command.cpp:
          (khtml::InsertTextCommand::input):
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.4104.2.100 +22 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.4104.2.99
  retrieving revision 1.4104.2.100
  diff -u -r1.4104.2.99 -r1.4104.2.100
  --- ChangeLog	9 Aug 2005 17:34:29 -0000	1.4104.2.99
  +++ ChangeLog	9 Aug 2005 17:48:47 -0000	1.4104.2.100
  @@ -2,6 +2,28 @@
   
           Merged fix from TOT to Safari-2-0-branch
   
  +    2005-08-04  Justin Garcia  <justin.garcia at apple.com>
  +
  +        Reviewed by kocienda
  +        
  +        Fix for: 
  +        - <rdar://problem/4132360> HIM-8A428:Space key works like Return key in Mail application.
  +        - <rdar://problem/4122708> Mail: when composing new mail with a Korean input method, the first space doesn't work
  +
  +        If the user terminates marked text with a space, a string including marked characters and a normal, 
  +        breaking space, is passed to WebCore in order to replace the previous marked sequence.  The fix ensures
  +        that the space becomes a non breaking space if necessary.
  +
  +        Test cases added:
  +        * manual-tests/korean-input-space.html
  +
  +        * khtml/editing/insert_text_command.cpp:
  +        (khtml::InsertTextCommand::input):
  +
  +2005-08-09  Adele Peterson  <adele at apple.com>
  +
  +        Merged fix from TOT to Safari-2-0-branch
  +
       2005-08-09  Adele Peterson  <adele at apple.com>
   
           Reviewed by Darin.
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.228.8.8 +18 -4     WebCore/khtml/editing/htmlediting.cpp
  
  Index: htmlediting.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/htmlediting.cpp,v
  retrieving revision 1.228.8.7
  retrieving revision 1.228.8.8
  diff -u -r1.228.8.7 -r1.228.8.8
  --- htmlediting.cpp	5 Aug 2005 18:01:19 -0000	1.228.8.7
  +++ htmlediting.cpp	9 Aug 2005 17:48:54 -0000	1.228.8.8
  @@ -150,7 +150,7 @@
   
   static DOMString &nonBreakingSpaceString()
   {
  -    static DOMString nonBreakingSpaceString = QString(QChar(0xa0));
  +    static DOMString nonBreakingSpaceString = QString(QChar(NON_BREAKING_SPACE));
       return nonBreakingSpaceString;
   }
   
  @@ -4020,10 +4020,24 @@
                   // those nbsp's added by the editor to make rendering come out right.
                   replaceTextInNode(textNode, offset - 1, 1, " ");
               }
  -            insertTextIntoNode(textNode, offset, text);
  -            endPosition = Position(textNode, offset + text.length());
  +            unsigned int len = text.length();
  +
  +#if APPLE_CHANGES
  +            // When the user hits space to finish marked sequence, the string that
  +            // we receive ends with a normal space, not a non breaking space.  This code
  +            // ensures that the right kind of space is produced.
  +            if (KWQ(document()->part())->markedTextRange() && text[len-1] == ' ') {
  +                DOMString textWithoutTrailingSpace(text.unicode(), len-1);
  +                insertTextIntoNode(textNode, offset, textWithoutTrailingSpace);
  +                insertSpace(textNode, offset + len-1);
  +            } else
  +                insertTextIntoNode(textNode, offset, text);
  +#else
   
  -            m_charactersAdded += text.length();
  +            insertTextIntoNode(textNode, offset, text);
  +#endif
  +            m_charactersAdded += len;
  +            endPosition = Position(textNode, offset + len);
           }
       }
   
  
  
  
  1.101.8.4 +2 -0      WebCore/khtml/editing/htmlediting.h
  
  Index: htmlediting.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/htmlediting.h,v
  retrieving revision 1.101.8.3
  retrieving revision 1.101.8.4
  diff -u -r1.101.8.3 -r1.101.8.4
  --- htmlediting.h	5 Aug 2005 18:01:20 -0000	1.101.8.3
  +++ htmlediting.h	9 Aug 2005 17:48:54 -0000	1.101.8.4
  @@ -34,6 +34,8 @@
   #include "selection.h"
   #include "shared.h"
   
  +#define NON_BREAKING_SPACE 0xa0
  +
   namespace DOM {
       class CSSMutableStyleDeclarationImpl;
       class CSSProperty;
  
  
  



More information about the webkit-changes mailing list