+2004-12-02 Richard Williamson <rjw@apple.com>
+
+ Fixed <rdar://problem/3841332> REGRESSION (125.9-167u): repro crash in -[KWQPageState invalidate] involving .Mac images
+
+ Ensure that the document is cleared when leaving a non-HTML page. This ensures that
+ the b/f cache won't incorrectly trash the previous state when restoring.
+
+ Reviewed by John.
+
+ * kwq/WebCoreBridge.h:
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge openURL:reload:contentType:refresh:lastModified:pageCache:]):
+ (-[WebCoreBridge canCachePage]):
+ (-[WebCoreBridge clear]):
+
2004-12-02 Ken Kocienda <kocienda@apple.com>
Reviewed by Richard
+2004-12-02 Richard Williamson <rjw@apple.com>
+
+ Fixed <rdar://problem/3841332> REGRESSION (125.9-167u): repro crash in -[KWQPageState invalidate] involving .Mac images
+
+ Ensure that the document is cleared when leaving a non-HTML page. This ensures that
+ the b/f cache won't incorrectly trash the previous state when restoring.
+
+ Reviewed by John.
+
+ * WebView.subproj/WebFrame.m:
+ (-[WebFrame _setState:]):
+
2004-12-02 Ken Kocienda <kocienda@apple.com>
Reviewed by Richard
&& loadType != WebFrameLoadTypeReloadAllowingStaleData
&& loadType != WebFrameLoadTypeSame
&& ![[self dataSource] isLoading]
- && ![[self dataSource] _isStopping]
- && [[[self dataSource] representation] isKindOfClass: [WebHTMLRepresentation class]])
+ && ![[self dataSource] _isStopping])
{
- if (![item pageCache]){
-
- // Add the items to this page's cache.
- if ([self _createPageCacheForItem:item]) {
- LOG(PageCache, "Saving page to back/forward cache, %@\n", [[self dataSource] _URL]);
-
- // See if any page caches need to be purged after the addition of this
- // new page cache.
- [self _purgePageCache];
- }
- else {
- LOG(PageCache, "NOT saving page to back/forward cache, unable to create items, %@\n", [[self dataSource] _URL]);
- }
- }
+ if ([[[self dataSource] representation] isKindOfClass: [WebHTMLRepresentation class]]) {
+ if (![item pageCache]){
+
+ // Add the items to this page's cache.
+ if ([self _createPageCacheForItem:item]) {
+ LOG(PageCache, "Saving page to back/forward cache, %@\n", [[self dataSource] _URL]);
+
+ // See if any page caches need to be purged after the addition of this
+ // new page cache.
+ [self _purgePageCache];
+ }
+ else {
+ LOG(PageCache, "NOT saving page to back/forward cache, unable to create items, %@\n", [[self dataSource] _URL]);
+ }
+ }
+ }
+ else {
+ // Put the document into a null state, so it can be restored correctly.
+ [_private->bridge clear];
+ }
}
else {
LOG(PageCache, "NOT saving page to back/forward cache, %@\n", [[self dataSource] _URL]);