WebCore:
authorharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Jul 2006 00:30:06 +0000 (00:30 +0000)
committerharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Jul 2006 00:30:06 +0000 (00:30 +0000)
        Reviewed by timo and Darin.

        <rdar://problem/4618584> "Paste and Match Style" is not working in Mail (add SPI)

        * WebCore.xcodeproj/project.pbxproj:
        * bridge/mac/WebCoreFrameBridge.h:
        * bridge/mac/WebCoreFrameBridge.mm:
        (-[WebCoreFrameBridge replaceSelectionWithNode:selectReplacement:smartReplace:matchStyle:]):
        Add matchStyle parameter for use by WebKit.

WebKit:

        Reviewed by timo and Darin.

        <rdar://problem/4618584> "Paste and Match Style" is not working in Mail (add SPI)

        * WebKit.xcodeproj/project.pbxproj:
        * WebView/WebView.m:
        (-[WebView replaceSelectionWithNode:]):
        (-[WebView _replaceSelectionWithNode:matchStyle:]):
        * WebView/WebViewPrivate.h:
        (-[WebView _replaceSelectionWithNode:matchStyle::]):
        New SPI that is same as replaceSelectionWithNode: with added parameter whether to match existing style.

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

WebCore/ChangeLog
WebCore/bridge/mac/WebCoreFrameBridge.h
WebCore/bridge/mac/WebCoreFrameBridge.mm
WebKit/ChangeLog
WebKit/WebView/WebView.m
WebKit/WebView/WebViewPrivate.h

index 9b7151ee1c0cc4f11d821248babb611f40b41210..3cc9738acb2d9532500f359bec69f14ecc53f027 100644 (file)
@@ -1,3 +1,15 @@
+2006-07-25  David Harrison  <harrison@apple.com>
+
+        Reviewed by timo and Darin.
+
+        <rdar://problem/4618584> "Paste and Match Style" is not working in Mail (add SPI)
+        
+        * WebCore.xcodeproj/project.pbxproj:
+        * bridge/mac/WebCoreFrameBridge.h:
+        * bridge/mac/WebCoreFrameBridge.mm:
+        (-[WebCoreFrameBridge replaceSelectionWithNode:selectReplacement:smartReplace:matchStyle:]):
+        Add matchStyle parameter for use by WebKit.
+
 2006-07-25  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by adele
index 6d56ec9511d48dca0b389ffc1bd5b49ae59ce756..6d8a52268275c0b672ec6c432b431de1888991c9 100644 (file)
@@ -422,7 +422,7 @@ typedef enum {
 - (DOMDocumentFragment *)documentFragmentWithNodesAsParagraphs:(NSArray *)nodes;
 
 - (void)replaceSelectionWithFragment:(DOMDocumentFragment *)fragment selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace matchStyle:(BOOL)matchStyle;
-- (void)replaceSelectionWithNode:(DOMNode *)node selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace;
+- (void)replaceSelectionWithNode:(DOMNode *)node selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace matchStyle:(BOOL)matchStyle;
 - (void)replaceSelectionWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace;
 - (void)replaceSelectionWithText:(NSString *)text selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace;
 
index 12bd2b4701fe4c1f28a45648e9b30fc83d260b6d..e7343858d9f70c136471e41195446466a2aec74a 100644 (file)
@@ -1971,11 +1971,11 @@ static HTMLFormElement *formElementFromDOMElement(DOMElement *element)
     [self ensureSelectionVisible];
 }
 
-- (void)replaceSelectionWithNode:(DOMNode *)node selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace
+- (void)replaceSelectionWithNode:(DOMNode *)node selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace matchStyle:(BOOL)matchStyle
 {
     DOMDocumentFragment *fragment = [[self DOMDocument] createDocumentFragment];
     [fragment appendChild:node];
-    [self replaceSelectionWithFragment:fragment selectReplacement:selectReplacement smartReplace:smartReplace matchStyle:NO];
+    [self replaceSelectionWithFragment:fragment selectReplacement:selectReplacement smartReplace:smartReplace matchStyle:matchStyle];
 }
 
 - (void)replaceSelectionWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace
index 6cda547980866e43cb26c7034d72d3a228b43306..2cae20c7f78b2d2142cd07acceed91899f276fe6 100644 (file)
@@ -1,3 +1,17 @@
+2006-07-25  David Harrison  <harrison@apple.com>
+
+        Reviewed by timo and Darin.
+
+        <rdar://problem/4618584> "Paste and Match Style" is not working in Mail (add SPI)
+        
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebView/WebView.m:
+        (-[WebView replaceSelectionWithNode:]):
+        (-[WebView _replaceSelectionWithNode:matchStyle:]):
+        * WebView/WebViewPrivate.h:
+        (-[WebView _replaceSelectionWithNode:matchStyle::]):
+        New SPI that is same as replaceSelectionWithNode: with added parameter whether to match existing style.
+
 2006-07-24  Darin Adler  <darin@apple.com>
 
         Reviewed by Adele and Justin.
index 6e9b5622e166cf976c842c75456173934059c3e5..a336c3cc6bdfbb8b47106dc147972b2508f8f356 100644 (file)
@@ -3208,7 +3208,7 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
 
 - (void)replaceSelectionWithNode:(DOMNode *)node
 {
-    [[self _bridgeForSelectedOrMainFrame] replaceSelectionWithNode:node selectReplacement:YES smartReplace:NO];
+    [[self _bridgeForSelectedOrMainFrame] replaceSelectionWithNode:node selectReplacement:YES smartReplace:NO matchStyle:NO];
 }    
 
 - (void)replaceSelectionWithText:(NSString *)text
@@ -3298,6 +3298,11 @@ FOR_EACH_RESPONDER_SELECTOR(FORWARD)
     _private->selectWordBeforeMenuEvent = flag;
 }
 
+- (void)_replaceSelectionWithNode:(DOMNode *)node matchStyle:(BOOL)matchStyle
+{
+    [[self _bridgeForSelectedOrMainFrame] replaceSelectionWithNode:node selectReplacement:YES smartReplace:NO matchStyle:matchStyle];
+}
+
 @end
 
 static WebFrameView *containingFrameView(NSView *view)
index 72d4fbbf65d83109695cb0a07fcdf45975a1042f..12a2a79eecdb82c34b923dd116b7069f5558ffdb 100644 (file)
@@ -284,6 +284,7 @@ Could be worth adding to the API.
 - (void)_insertNewlineInQuotedContent;
 - (BOOL)_selectWordBeforeMenuEvent;
 - (void)_setSelectWordBeforeMenuEvent:(BOOL)flag;
+- (void)_replaceSelectionWithNode:(DOMNode *)node matchStyle:(BOOL)matchStyle;
 @end
 
 @interface _WebSafeForwarder : NSObject