2009-01-14 Darin Adler <darin@apple.com>
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Jan 2009 19:37:19 +0000 (19:37 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Jan 2009 19:37:19 +0000 (19:37 +0000)
        Reviewed by Oliver Hunt.

        Fix crash I ran into while printing. I was unable to reproduce it, but also,
        it's clear there's no guarantee that the frame will be non-zero in this case,
        so it seems fine to check it.

        * WebView/WebHTMLView.mm: (-[WebHTMLView reapplyStyles]): Check frame for zero
        and don't do anything with it if it's zero.

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

WebKit/mac/ChangeLog
WebKit/mac/WebView/WebHTMLView.mm

index 4850834..258fec9 100644 (file)
@@ -1,3 +1,14 @@
+2009-01-14  Darin Adler  <darin@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        Fix crash I ran into while printing. I was unable to reproduce it, but also,
+        it's clear there's no guarantee that the frame will be non-zero in this case,
+        so it seems fine to check it.
+
+        * WebView/WebHTMLView.mm: (-[WebHTMLView reapplyStyles]): Check frame for zero
+        and don't do anything with it if it's zero.
+
 2009-01-14  Dan Bernstein  <mitz@apple.com>
 
         Reviewed by John Sullivan.
index d4b751a..be4d8db 100644 (file)
@@ -2774,12 +2774,13 @@ static void _updateFocusedAndActiveStateTimerCallback(CFRunLoopTimerRef timer, v
     double start = CFAbsoluteTimeGetCurrent();
 #endif
 
-    Frame* coreFrame = core([self _frame]);
-    if (FrameView* coreView = coreFrame->view())
-        coreView->setMediaType(_private->printing ? "print" : "screen");
-    if (Document* document = coreFrame->document())
-        document->setPrinting(_private->printing);
-    coreFrame->reapplyStyles();
+    if (Frame* coreFrame = core([self _frame])) {
+        if (FrameView* coreView = coreFrame->view())
+            coreView->setMediaType(_private->printing ? "print" : "screen");
+        if (Document* document = coreFrame->document())
+            document->setPrinting(_private->printing);
+        coreFrame->reapplyStyles();
+    }
     
 #ifdef LOG_TIMES        
     double thisTime = CFAbsoluteTimeGetCurrent() - start;