Reviewed by John.
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Jan 2005 02:01:47 +0000 (02:01 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Jan 2005 02:01:47 +0000 (02:01 +0000)
        - fixed <rdar://problem/3829517> WebView still draws white when setDrawsBackground set to NO and no content loaded yet

        * WebView.subproj/WebFrameView.m: (-[WebFrameView drawRect:]): Check drawsBackground, and don't
        draw the white "no document" background if it's NO. This fixes things for frames with no document.
        * WebView.subproj/WebImageView.m: (-[WebImageView drawRect:]): Same as above. This fixes things
        for frames with just an image.
        * WebView.subproj/WebFrame.m: (-[WebFrame _updateDrawsBackground]): Call setDrawsBackground: on the
        document view if it implements it. This fixes things for frames with plain text.

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

WebKit/ChangeLog
WebKit/WebView.subproj/WebFrame.m
WebKit/WebView.subproj/WebFrameView.m
WebKit/WebView.subproj/WebImageView.m

index ec7598b3c5d23ac123fb823fba19d68d8c00c539..8e112fb3077c66d0395d984ce5778d99d58b9f21 100644 (file)
@@ -1,3 +1,16 @@
+2005-01-26  Darin Adler  <darin@apple.com>
+
+        Reviewed by John.
+
+        - fixed <rdar://problem/3829517> WebView still draws white when setDrawsBackground set to NO and no content loaded yet
+
+        * WebView.subproj/WebFrameView.m: (-[WebFrameView drawRect:]): Check drawsBackground, and don't
+        draw the white "no document" background if it's NO. This fixes things for frames with no document.
+        * WebView.subproj/WebImageView.m: (-[WebImageView drawRect:]): Same as above. This fixes things
+        for frames with just an image.
+        * WebView.subproj/WebFrame.m: (-[WebFrame _updateDrawsBackground]): Call setDrawsBackground: on the
+        document view if it implements it. This fixes things for frames with plain text.
+
 2005-01-25  John Sullivan  <sullivan@apple.com>
 
         Reviewed by Chris.
index 15f901de3b8724862489bfec054c35d0bb933529..a28198e3e99931220d4edc983bea0eb902497c44 100644 (file)
@@ -2534,6 +2534,9 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     BOOL drawsBackground = [[self webView] drawsBackground];
     if (!drawsBackground)
         [[[self frameView] _scrollView] setDrawsBackground:NO];
+    id documentView = [[self frameView] documentView];
+    if ([documentView respondsToSelector:@selector(setDrawsBackground:)])
+        [documentView setDrawsBackground:drawsBackground];
     [[self _bridge] setDrawsBackground:drawsBackground];
     [_private->children makeObjectsPerformSelector:@selector(_updateDrawsBackground)];
 }
index f8de5e86a675e31238b11298abef00c1a31d749d..4c31390ac29b02ce0d0d3462c4b7825a31751ba0 100644 (file)
@@ -432,8 +432,10 @@ static NSMutableDictionary *viewTypes;
 {
     if ([self documentView] == nil) {
         // Need to paint ourselves if there's no documentView to do it instead.
-        [[NSColor whiteColor] set];
-        NSRectFill(rect);
+        if ([[self _webView] drawsBackground]) {
+            [[NSColor whiteColor] set];
+            NSRectFill(rect);
+        }
     } else {
 #ifndef NDEBUG
         if ([[self _scrollView] drawsBackground]) {
index eb2138e2b64fbd2ec22e056d168d4c006144f482..5bc790d56b6736f7e66b9a139d3c6a1d9a90d055 100644 (file)
         [self layout];
     }
     
-    [[NSColor whiteColor] set];
-    NSRectFill(rect);
+    if ([[self _webView] drawsBackground]) {
+        [[NSColor whiteColor] set];
+        NSRectFill(rect);
+    }
     
     NSRect drawingRect = [self drawingRect];
     [[rep image] drawImageInRect:drawingRect fromRect:drawingRect];