[webkit-changes] cvs commit: WebCore/kwq KWQTextArea.mm

Timothy thatcher at opensource.apple.com
Wed Dec 14 14:49:52 PST 2005


thatcher    05/12/14 14:49:52

  Modified:    .        Tag: Safari-2-0-branch ChangeLog
               kwq      Tag: Safari-2-0-branch KWQTextArea.mm
  Log:
          Merged fix from TOT to Safari-2-0-branch
  
      2005-12-14  Beth Dakin  <bdakin at apple.com>
  
          Reviewed by Eric.
  
          Fix for <rdar://problem/4374783> 10.4.4 REGRESSION: caret
          disappears when typing at the bottom of a scrollable textarea.
  
          This regression occurred because we were calculating the font
          height incorrectly. Made changes that Doug suggested in the bug.
  
          * kwq/KWQTextArea.mm:
          (-[KWQTextAreaTextView setFont:]): Send the font itself to
          _KWQ_updateTypingAttributes
          (-[KWQTextAreaTextView setLineHeight:]): Same.
          (-[NSTextView _KWQ_updateTypingAttributes:forLineHeight:font:]):
          Calculate the font height using defaultLineHeightForFont.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.104 +21 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.1.2.103
  retrieving revision 1.1.2.104
  diff -u -r1.1.2.103 -r1.1.2.104
  --- ChangeLog	13 Dec 2005 21:12:48 -0000	1.1.2.103
  +++ ChangeLog	14 Dec 2005 22:49:47 -0000	1.1.2.104
  @@ -1,3 +1,24 @@
  +2005-12-14  Timothy Hatcher  <timothy at apple.com>
  +
  +        Merged fix from TOT to Safari-2-0-branch
  +
  +    2005-12-14  Beth Dakin  <bdakin at apple.com>
  +
  +        Reviewed by Eric.
  +
  +        Fix for <rdar://problem/4374783> 10.4.4 REGRESSION: caret 
  +        disappears when typing at the bottom of a scrollable textarea.
  +    
  +        This regression occurred because we were calculating the font
  +        height incorrectly. Made changes that Doug suggested in the bug.
  +
  +        * kwq/KWQTextArea.mm:
  +        (-[KWQTextAreaTextView setFont:]): Send the font itself to 
  +        _KWQ_updateTypingAttributes
  +        (-[KWQTextAreaTextView setLineHeight:]): Same.
  +        (-[NSTextView _KWQ_updateTypingAttributes:forLineHeight:font:]):
  +        Calculate the font height using defaultLineHeightForFont.
  +
   === WebCore-417.12 ===
   
   2005-12-12  Timothy Hatcher  <timothy at apple.com>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.72.8.9  +6 -4      WebCore/kwq/KWQTextArea.mm
  
  Index: KWQTextArea.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQTextArea.mm,v
  retrieving revision 1.72.8.8
  retrieving revision 1.72.8.9
  diff -u -r1.72.8.8 -r1.72.8.9
  --- KWQTextArea.mm	12 Nov 2005 01:57:18 -0000	1.72.8.8
  +++ KWQTextArea.mm	14 Dec 2005 22:49:52 -0000	1.72.8.9
  @@ -61,7 +61,7 @@
   @interface NSTextView (KWQTextArea)
   - (NSParagraphStyle *)_KWQ_typingParagraphStyle;
   - (void)_KWQ_setTypingParagraphStyle:(NSParagraphStyle *)style;
  -- (void)_KWQ_updateTypingAttributes:(NSParagraphStyle *)style forLineHeight:(float)lineHeight fontHeight:(float)fontHeight;
  +- (void)_KWQ_updateTypingAttributes:(NSParagraphStyle *)style forLineHeight:(float)lineHeight font:(NSFont *)font;
   @end
   
   @interface NSTextStorage (KWQTextArea)
  @@ -442,7 +442,7 @@
       
       NSParagraphStyle *style = [textView _KWQ_typingParagraphStyle];
       if (_lineHeight) {
  -        [textView _KWQ_updateTypingAttributes:style forLineHeight:_lineHeight fontHeight:([_font ascender] - [_font descender])];
  +        [textView _KWQ_updateTypingAttributes:style forLineHeight:_lineHeight font:_font];
       }
   }
   
  @@ -490,7 +490,7 @@
       }
       NSMutableParagraphStyle *newStyle = [paraStyle mutableCopy];
       [newStyle setMinimumLineHeight:lineHeight];
  -    [textView _KWQ_updateTypingAttributes:newStyle forLineHeight:lineHeight fontHeight:([_font ascender] - [_font descender])];
  +    [textView _KWQ_updateTypingAttributes:newStyle forLineHeight:lineHeight font:_font];
       [newStyle release];
   }
   
  @@ -1008,11 +1008,13 @@
       [attributes release];
   }
   
  -- (void)_KWQ_updateTypingAttributes:(NSParagraphStyle *)style forLineHeight:(float)lineHeight fontHeight:(float)fontHeight
  +- (void)_KWQ_updateTypingAttributes:(NSParagraphStyle *)style forLineHeight:(float)lineHeight font:(NSFont *)font
   {
       NSDictionary *typingAttrs = [self typingAttributes];
       NSMutableDictionary *dict;
  +    float fontHeight = [[self layoutManager] defaultLineHeightForFont:font];
       float h = (lineHeight / 2.0f) - (fontHeight / 2.0f);
  +    h = (h >= 0.0) ? floorf(h) : -floorf(-h);
       
       if (typingAttrs)
           dict = [typingAttrs mutableCopy];
  
  
  



More information about the webkit-changes mailing list