Reviewed by Ken and Darin.
authorharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 20 Nov 2004 01:36:53 +0000 (01:36 +0000)
committerharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 20 Nov 2004 01:36:53 +0000 (01:36 +0000)
        <rdar://problem/3856215> Cannot remove bold from the beginning of a message

        Problem is that KHTMLPart::computeAndSetTypingStyle always looked upstream
        for the existing style, but in this case (hitting cmd-B with caret at top of
        file) there is nothing upstream.  Changed this to use the VisiblePosition
        deepEquivalent instead.

        * khtml/khtml_part.cpp:
        (KHTMLPart::computeAndSetTypingStyle):

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

WebCore/ChangeLog-2005-08-23
WebCore/khtml/khtml_part.cpp

index aa5abd9..fc691ae 100644 (file)
@@ -1,3 +1,17 @@
+2004-11-19  David Harrison  <harrison@apple.com>
+
+        Reviewed by Ken and Darin.
+
+        <rdar://problem/3856215> Cannot remove bold from the beginning of a message
+
+        Problem is that KHTMLPart::computeAndSetTypingStyle always looked upstream
+        for the existing style, but in this case (hitting cmd-B with caret at top of
+        file) there is nothing upstream.  Changed this to use the VisiblePosition
+        deepEquivalent instead.
+        
+        * khtml/khtml_part.cpp:
+        (KHTMLPart::computeAndSetTypingStyle):
+
 === Safari-172 ===
 
 2004-11-19  Maciej Stachowiak  <mjs@apple.com>
index f1fb3d5..72f185f 100644 (file)
@@ -5338,7 +5338,9 @@ void KHTMLPart::computeAndSetTypingStyle(CSSStyleDeclarationImpl *style)
         mutableStyle = typingStyle();
         mutableStyle->ref();
     }
-    CSSComputedStyleDeclarationImpl computedStyle(selection().start().upstream(StayInBlock).node());
+
+    NodeImpl *node = VisiblePosition(selection().start()).deepEquivalent().node();
+    CSSComputedStyleDeclarationImpl computedStyle(node);
     computedStyle.diff(mutableStyle);
     
     // Handle block styles, substracting these from the typing style.