Fix for 3802766, entire view redrawn in Blot while typing. Don't needlessly create...
authorhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Sep 2004 18:42:39 +0000 (18:42 +0000)
committerhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Sep 2004 18:42:39 +0000 (18:42 +0000)
out the font for the caret position.

        Reviewed by darin

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::fontForSelection):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@7628 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog-2005-08-23
WebCore/kwq/KWQKHTMLPart.mm

index 0eda85b4aed03b4653a342252430598e69e2004e..3d967b30e8fb700e9dac808d884bffca7bd2093c 100644 (file)
@@ -1,3 +1,13 @@
+2004-09-22  David Hyatt  <hyatt@apple.com>
+
+       Fix for 3802766, entire view redrawn in Blot while typing.  Don't needlessly create text nodes just to find
+       out the font for the caret position.
+       
+        Reviewed by darin
+
+        * kwq/KWQKHTMLPart.mm:
+        (KWQKHTMLPart::fontForSelection):
+
 2004-09-21  Chris Blumenberg  <cblu@apple.com>
 
        Fixed:
index be9eb3eea49ad7aed0f5dfa474e3d6681084e193..9a5c3028525b2bee5fde33f2a33159f0f976d88d 100644 (file)
@@ -3336,15 +3336,16 @@ NSFont *KWQKHTMLPart::fontForSelection(bool *hasMultipleFonts) const
         NodeImpl *node = pos.node();
         if (!node)
             return nil;
+        
+        if (!d->m_typingStyle)
+            return node->renderer()->style()->font().getNSFont();
 
         int exceptionCode = 0;
         ElementImpl *styleElement = xmlDocImpl()->createHTMLElement("span", exceptionCode);
         ASSERT(exceptionCode == 0);
         
-        if (d->m_typingStyle) {
-            styleElement->setAttribute(ATTR_STYLE, d->m_typingStyle->cssText().implementation(), exceptionCode);
-            ASSERT(exceptionCode == 0);
-        }
+        styleElement->setAttribute(ATTR_STYLE, d->m_typingStyle->cssText().implementation(), exceptionCode);
+        ASSERT(exceptionCode == 0);
         
         TextImpl *text = xmlDocImpl()->createEditingTextNode("");
         styleElement->appendChild(text, exceptionCode);