Reviewed by Ken.
authorsullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Aug 2004 17:39:40 +0000 (17:39 +0000)
committersullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Aug 2004 17:39:40 +0000 (17:39 +0000)
        - WebKit part of fix for <rdar://problem/3607720> myFrame.print() prints the window
        but should only print the frame

        * WebView.subproj/WebUIDelegatePrivate.h:
        declare new delegate method that includes which frame to print

        * WebView.subproj/WebDefaultUIDelegate.m:
        (-[WebDefaultUIDelegate webView:printFrameView:]):
        implement default (no-op) version of new delegate method

        * WebCoreSupport.subproj/WebBridge.m:
        (-[WebBridge print]):
        call new delegate method if available, otherwise call old delegate method, for
        backward compatibility.

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

WebKit/ChangeLog
WebKit/WebCoreSupport.subproj/WebBridge.m
WebKit/WebView.subproj/WebDefaultUIDelegate.m
WebKit/WebView.subproj/WebUIDelegatePrivate.h

index bee18eecbf843e6808d77c819f3cc0bdb5c97b87..8fc8787973eb8103e12e42939872c5718150a126 100644 (file)
@@ -1,3 +1,22 @@
+2004-08-30  John Sullivan  <sullivan@apple.com>
+
+        Reviewed by Ken.
+
+        - WebKit part of fix for <rdar://problem/3607720> myFrame.print() prints the window 
+        but should only print the frame
+
+        * WebView.subproj/WebUIDelegatePrivate.h:
+        declare new delegate method that includes which frame to print
+
+        * WebView.subproj/WebDefaultUIDelegate.m:
+        (-[WebDefaultUIDelegate webView:printFrameView:]):
+        implement default (no-op) version of new delegate method
+
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge print]):
+        call new delegate method if available, otherwise call old delegate method, for
+        backward compatibility.
+
 2004-08-27  Maciej Stachowiak  <mjs@apple.com>
 
         Reviewed by John. 
index 4317717f04fb0e46cb707cbf3637899d37ffaa65..2aea35ab339739274c10355b942bcd4b9a68384f 100644 (file)
@@ -1251,10 +1251,13 @@ static id <WebFormDelegate> formDelegate(WebBridge *self)
 {
     id wd = [[_frame webView] UIDelegate];
     
-    if ([wd respondsToSelector:@selector(webViewPrint:)]) {
+    if ([wd respondsToSelector:@selector(webView:printFrameView:)]) {
+        [wd webView:[_frame webView] printFrameView:[_frame frameView]];
+    } else if ([wd respondsToSelector:@selector(webViewPrint:)]) {
+        // Backward-compatible, but webViewPrint: was never public, so probably not needed.
         [wd webViewPrint:[_frame webView]];
     } else {
-        [[WebDefaultUIDelegate sharedUIDelegate] webViewPrint:[_frame webView]];
+        [[WebDefaultUIDelegate sharedUIDelegate] webView:[_frame webView] printFrameView:[_frame frameView]];
     }
 }
 
index c864ec155b226d7c3d429416cb91be11b1b454c4..823e967598ae2ff403a42b82c08e19c3649c5bd4 100644 (file)
@@ -168,6 +168,11 @@ static WebDefaultUIDelegate *sharedDelegate = nil;
 {
 }
 
+- (void)webView:(WebView *)sender printFrameView:(WebFrameView *)frameView
+{
+}
+
+
 - (BOOL)webView:(WebView *)webView shouldBeginDragForElement:(NSDictionary *)element dragImage:(NSImage *)dragImage mouseDownEvent:(NSEvent *)mouseDownEvent mouseDraggedEvent:(NSEvent *)mouseDraggedEvent
 {
     return YES;
index 1fc27b5b10b05d965a57f4513b9ca4ebc9bc7b0f..9e2c322352c342a87081c6df162b99cad9b40cf2 100644 (file)
@@ -7,7 +7,9 @@
 
 @interface NSObject (WebUIDelegatePrivate)
 
+// webViewPrint: is obsolete; delegates should respond to webView:printFrameView: instead
 - (void)webViewPrint:(WebView *)sender;
+- (void)webView:(WebView *)sender printFrameView:(WebFrameView *)frameView;
 
 - (float)webViewHeaderHeight:(WebView *)sender;
 - (float)webViewFooterHeight:(WebView *)sender;