+2007-09-04 Timothy Hatcher <timothy@apple.com>
+
+ Reviewed by Darin.
+
+ <rdar://problem/5452908> NIBs saved in the Pre-10.2 format while Safari 3 installed do not work without Safari 3
+
+ This happened because we encoded a new field that the old WebKit does not know how to read.
+ And NSCoder throws an exception if initWithCoder finishes while there is still unread data in the archive.
+
+ The WebViewVersion is now 4 to distinguish that we do not encode/decode allowsUndo.
+
+ * WebView/WebView.mm:
+ (-[WebView initWithCoder:]): Only try to read allowsUndo if the version is 3.
+ (-[WebView encodeWithCoder:]): No longer encode allowsUndo.
+
2007-09-04 David Hyatt <hyatt@apple.com>
Fix for <rdar://problem/5271213>, resizing iChat window is slower than in
NSString * const WebViewDidChangeTypingStyleNotification = @"WebViewDidChangeTypingStyleNotification";
NSString * const WebViewDidChangeSelectionNotification = @"WebViewDidChangeSelectionNotification";
-enum { WebViewVersion = 3 };
+enum { WebViewVersion = 4 };
#define timedLayoutSize 4096
preferences = [decoder decodeObject];
if (version > 1)
[decoder decodeValuesOfObjCTypes:"c", &useBackForwardList];
- if (version > 2)
+ // The allowsUndo field is no longer written out in encodeWithCoder, but since there are
+ // version 3 NIBs that have this field encoded, we still need to read it in.
+ if (version == 3)
[decoder decodeValuesOfObjCTypes:"c", &allowsUndo];
}
[encoder encodeObject:[self groupName]];
[encoder encodeObject:[self preferences]];
[encoder encodeValuesOfObjCTypes:"c", &useBackForwardList];
- [encoder encodeValuesOfObjCTypes:"c", &_private->allowsUndo];
+ // DO NOT encode any new fields here, doing so will break older WebKit releases.
}
LOG(Encoding, "FrameName = %@, GroupName = %@, useBackForwardList = %d\n", [[self mainFrame] name], [self groupName], (int)useBackForwardList);