[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

rjw rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:39:31 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 5ed2d6a22aadb24581f952f9c27a28b7a1b49112
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Apr 30 22:03:00 2003 +0000

    WebFoundation:
            Added utility _web_URLFragment.
    
            Reviewed by Darin.
    
            * Misc.subproj/WebNSStringExtras.h:
            * Misc.subproj/WebNSStringExtras.m:
            (-[NSString _web_URLFragment]):
    
    WebKit:
            API changes from final review meeting.
    
            Moved view registry to WebView.
            Changed WebHistoryItem to use NSTimeInterval (at least for public API).
            Still creates a NSCalendarDate for compatibility.  We should wean Safari
            off it's use of NSCalendarDate.
            Added public init method for WebHistoryItem.
            Removed anchor from WebHistoryItem.
            Added WebHistorySavedNotification.
    
            Reviewed by Darin.
    
            * History.subproj/WebHistory.m:
            (-[WebHistory addItemForURL:]):
            * History.subproj/WebHistoryItem.h:
            * History.subproj/WebHistoryItem.m:
            (-[WebHistoryItem initWithURLString:title:lastVisitedTimeInterval:]):
            (-[WebHistoryItem copyWithZone:]):
            (-[WebHistoryItem lastVisitedTimeInterval]):
            (-[WebHistoryItem anchor]):
            (-[WebHistoryItem _setLastVisitedTimeInterval:]):
            (-[WebHistoryItem _lastVisitedDate]):
            (-[WebHistoryItem dictionaryRepresentation]):
            (-[WebHistoryItem initFromDictionaryRepresentation:]):
            * History.subproj/WebHistoryItemPrivate.h:
            * History.subproj/WebHistoryPrivate.m:
            (-[WebHistoryPrivate insertItem:atDateIndex:]):
            (-[WebHistoryPrivate removeItemForURLString:]):
            (-[WebHistoryPrivate addItem:]):
            (-[WebHistoryPrivate _loadHistoryGuts:URL:error:]):
            * Plugins.subproj/WebPluginDatabase.m:
            (-[WebPluginDatabase init]):
            * WebView.subproj/WebFrame.h:
            * WebView.subproj/WebFrame.m:
            * WebView.subproj/WebFramePrivate.m:
            (-[WebFrame _transitionToCommitted:]):
            * WebView.subproj/WebView.h:
            * WebView.subproj/WebView.m:
            (+[WebView registerViewClass:representationClass:forMIMEType:]):
    
    WebBrowser:
            API changes from final review meeting.
    
            Changed WebHistoryItem to use NSTimeInterval (at least for public API).
            Still creates a NSCalendarDate for compatibility.  We should wean Safari
            off it's use of NSCalendarDate.
            Added public init method for WebHistoryItem.
            Removed anchor from WebHistoryItem.
    
            Reviewed by Darin.
    
            * Debug/DebugUtilities.m:
            (-[WebHistory populateHistoryWithTestData:]):
            * GlobalHistory.m:
            (-[GlobalHistory parentOfContentItem:]):
            * WebBookmarkLeaf.m:
            (-[WebBookmarkLeaf init]):
            (-[WebBookmarkLeaf setLastVisitedDate:]):
            (-[WebBookmarkLeaf lastVisitedDate]):
    
    Tests:
            API changes from final review meeting.
            Moved view registry to WebView.
    
            Reviewed by Darin.
    
            * PDFBundle/PDFView.m:
            (+[PDFPluginViewFactory load]):
            * PDFViewer/ApplicationController.m:
            (-[ApplicationController awakeFromNib]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4222 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 20b2cc7..55f02e3 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,45 @@
+2003-04-30  Richard Williamson   <rjw at apple.com>
+
+        API changes from final review meeting.
+        
+        Moved view registry to WebView.
+        Changed WebHistoryItem to use NSTimeInterval (at least for public API).
+        Still creates a NSCalendarDate for compatibility.  We should wean Safari
+        off it's use of NSCalendarDate.
+        Added public init method for WebHistoryItem.
+        Removed anchor from WebHistoryItem.
+        Added WebHistorySavedNotification.
+        
+        Reviewed by Darin.
+
+        * History.subproj/WebHistory.m:
+        (-[WebHistory addItemForURL:]):
+        * History.subproj/WebHistoryItem.h:
+        * History.subproj/WebHistoryItem.m:
+        (-[WebHistoryItem initWithURLString:title:lastVisitedTimeInterval:]):
+        (-[WebHistoryItem copyWithZone:]):
+        (-[WebHistoryItem lastVisitedTimeInterval]):
+        (-[WebHistoryItem anchor]):
+        (-[WebHistoryItem _setLastVisitedTimeInterval:]):
+        (-[WebHistoryItem _lastVisitedDate]):
+        (-[WebHistoryItem dictionaryRepresentation]):
+        (-[WebHistoryItem initFromDictionaryRepresentation:]):
+        * History.subproj/WebHistoryItemPrivate.h:
+        * History.subproj/WebHistoryPrivate.m:
+        (-[WebHistoryPrivate insertItem:atDateIndex:]):
+        (-[WebHistoryPrivate removeItemForURLString:]):
+        (-[WebHistoryPrivate addItem:]):
+        (-[WebHistoryPrivate _loadHistoryGuts:URL:error:]):
+        * Plugins.subproj/WebPluginDatabase.m:
+        (-[WebPluginDatabase init]):
+        * WebView.subproj/WebFrame.h:
+        * WebView.subproj/WebFrame.m:
+        * WebView.subproj/WebFramePrivate.m:
+        (-[WebFrame _transitionToCommitted:]):
+        * WebView.subproj/WebView.h:
+        * WebView.subproj/WebView.m:
+        (+[WebView registerViewClass:representationClass:forMIMEType:]):
+
 2003-04-29  Maciej Stachowiak  <mjs at apple.com>
 
         Reviewed by Darin.
diff --git a/WebKit/History.subproj/WebHistory.h b/WebKit/History.subproj/WebHistory.h
index 24548f2..4941b53 100644
--- a/WebKit/History.subproj/WebHistory.h
+++ b/WebKit/History.subproj/WebHistory.h
@@ -26,6 +26,7 @@ extern NSString *WebHistoryItemsAddedNotification;
 extern NSString *WebHistoryItemsRemovedNotification;
 extern NSString *WebHistoryAllItemsRemovedNotification;
 extern NSString *WebHistoryLoadedNotification;
+extern NSString *WebHistorySavedNotification;
 
 extern NSString *WebHistoryItemsKey;
 
diff --git a/WebKit/History.subproj/WebHistory.m b/WebKit/History.subproj/WebHistory.m
index ea4e0c5..25201b2 100644
--- a/WebKit/History.subproj/WebHistory.m
+++ b/WebKit/History.subproj/WebHistory.m
@@ -22,6 +22,7 @@ NSString *WebHistoryItemsAddedNotification = @"WebHistoryItemsAddedNotification"
 NSString *WebHistoryItemsRemovedNotification = @"WebHistoryItemsRemovedNotification";
 NSString *WebHistoryAllItemsRemovedNotification = @"WebHistoryAllItemsRemovedNotification";
 NSString *WebHistoryLoadedNotification = @"WebHistoryLoadedNotification";
+NSString *WebHistorySavedNotification = @"WebHistorySavedNotification";
 NSString *WebHistoryItemsKey = @"WebHistoryItems";
 
 static WebHistory *_sharedHistory = nil;
@@ -99,7 +100,7 @@ static WebHistory *_sharedHistory = nil;
 - (WebHistoryItem *)addItemForURL: (NSURL *)URL
 {
     WebHistoryItem *entry = [[WebHistoryItem alloc] initWithURL:URL title:nil];
-    [entry setLastVisitedDate: [NSCalendarDate date]];
+    [entry _setLastVisitedTimeInterval: [NSDate timeIntervalSinceReferenceDate]];
     [self addItem: entry];
     [entry release];
     return entry;
@@ -190,7 +191,13 @@ static WebHistory *_sharedHistory = nil;
 - (BOOL)saveToURL:(NSURL *)URL error:(NSError **)error
 {
     // FIXME:  Use new foundation API to get error when ready.
-    return [_historyPrivate saveToURL:URL error:error];
+    if([_historyPrivate saveToURL:URL error:error]){
+        [[NSNotificationCenter defaultCenter]
+            postNotificationName: WebHistorySavedNotification
+                          object: self];
+        return YES;
+    }
+    return NO;    
 }
 
 - (WebHistoryItem *)_itemForURLString:(NSString *)URLString
diff --git a/WebKit/History.subproj/WebHistoryItem.h b/WebKit/History.subproj/WebHistoryItem.h
index 136eba7..79ebb49 100644
--- a/WebKit/History.subproj/WebHistoryItem.h
+++ b/WebKit/History.subproj/WebHistoryItem.h
@@ -15,8 +15,7 @@
     @discussion  WebHistoryItems are created by WebKit to represent pages visited.
     The WebBackForwardList and WebHistory classes both use WebHistoryItems to represent
     pages visited.  With the exception of the displayTitle, the properties of 
-    WebHistoryItems are set by WebKit.
-    WebHistoryItems cannot be created directly.
+    WebHistoryItems are set by WebKit.  WebHistoryItems are normally never created directly.
 */
 @interface WebHistoryItem : NSObject <NSCopying>
 {
@@ -25,27 +24,55 @@
 }
 
 /*!
-    @method URLString
-    @abstract The string representation of the URL represented by this item.
-    @discussion The URLString may be different than the originalURLString if the page
-    redirected to a new location.
+    @method initWithURLString:title:lastVisitedTimeInterval:
+    @param URLString The URL string for the item.
+    @param title The title to use for the item.  This is normally the <title> of a page.
+    @param time The time used to indicate when the item was used.
+    @abstract Initialize a new WebHistoryItem
+    @discussion WebHistoryItems are normally created for you by the WebKit.
+    You may use this method to prepopulate a WebBackForwardList, or create
+    'artificial' items to add to a WebBackForwardList.  When first initialized
+    the URLString and originalURLString will be the same.
 */
-- (NSString *)URLString;
+- (id)initWithURLString:(NSString *)URLString title:(NSString *)title lastVisitedTimeInterval:(NSTimeInterval)time;
 
 /*!
     @method originalURLString
     @abstract The string representation of the originial URL of this item.
+    This value is normally set by the WebKit.
+    @result The string corresponding to the initial URL of this item.
 */
 - (NSString *)originalURLString;
 
 /*!
+    @method URLString
+    @abstract The string representation of the URL represented by this item.
+    @discussion The URLString may be different than the originalURLString if the page
+    redirected to a new location.  This value is normally set by the WebKit.
+    @result The string corresponding to the final URL of this item.
+*/
+- (NSString *)URLString;
+
+
+/*!
     @method title
     @abstract The title of the page represented by this item.
-    @discussion This title cannot be changed by the client.
+    @discussion This title cannot be changed by the client.  This value
+    is normally set by the WebKit when a page title for the item is received.
+    @result The title of this item.
 */
 - (NSString *)title;
 
 /*!
+    @method lastVisitedTimeInterval
+    @abstract The last time the page represented by this item was visited. The interval
+    is since the reference date as determined by NSDate.  This value is normally set by
+    the WebKit.
+    @result The last time this item was visited.
+*/
+- (NSTimeInterval)lastVisitedTimeInterval;
+
+/*!
     @method setAlternateTitle:
     @param alternateTitle The new display title for this item.
     @abstract A title that may be used by the client to display this item.
@@ -55,25 +82,16 @@
 /*
     @method title
     @abstract A title that may be used by the client to display this item.
+    @result The alternate title for this item.
 */
 - (NSString *)alternateTitle;
 
 /*!
     @method icon
     @abstract The favorite icon of the page represented by this item.
+    @discussion This icon returned will be determined by the WebKit.
+    @result The icon associated with this item's URL.
 */
 - (NSImage *)icon;
 
-/*!
-    @method lastVisitedDate
-    @abstract The last time the page represented by this item was visited.
-*/
-- (NSCalendarDate *)lastVisitedDate;
-
-/*!
-    @method anchor
-    @abstract The name of the fragment anchor, if any, represented by the URL for this item.
-*/
-- (NSString *)anchor;
-
 @end
diff --git a/WebKit/History.subproj/WebHistoryItem.m b/WebKit/History.subproj/WebHistoryItem.m
index 38fbbfe..73fc472 100644
--- a/WebKit/History.subproj/WebHistoryItem.m
+++ b/WebKit/History.subproj/WebHistoryItem.m
@@ -16,6 +16,14 @@
 
 #import <CoreGraphics/CoreGraphicsPrivate.h>
 
+// Private keys used in the WebHistoryItem's dictionary representation.
+static NSString *WebLastVisitedTimeIntervalKey = @"lastVisitedTimeInterval";
+static NSString *WebVisitCountKey = @"visitCount";
+static NSString *WebOBSOLETELastVisitedDateKey = @"lastVisitedDate";
+static NSString *WebTitleKey = @"title";
+static NSString *WebChildrenKey = @"children";
+static NSString *WebDisplayTitleKey = @"displayTitle";
+
 @interface WebHistoryItemPrivate : NSObject
 {
 @public
@@ -26,8 +34,8 @@
     NSString *title;
     NSString *displayTitle;
     NSCalendarDate *lastVisitedDate;
+    NSTimeInterval lastVisitedTimeInterval;
     NSPoint scrollPoint;
-    NSString *anchor;
     NSArray *documentState;
     NSMutableArray *subItems;
     NSMutableDictionary *pageCache;
@@ -51,7 +59,6 @@
     [title release];
     [displayTitle release];
     [lastVisitedDate release];
-    [anchor release];
     [documentState release];
     [subItems release];
     [pageCache release];
@@ -72,6 +79,17 @@
     return self;
 }
 
+- (id)initWithURLString:(NSString *)URLString title:(NSString *)title lastVisitedTimeInterval:(NSTimeInterval)time
+{
+    self = [super init];
+    _private->lastVisitedTimeInterval = time;
+    _private->title = [title copy];
+    _private->URLString = [URLString copy];
+    _private->originalURLString = [_private->URLString retain];
+    [self _retainIconInDatabase:YES];
+    return self;
+}
+
 - (void)dealloc
 {
     [self _retainIconInDatabase:NO];
@@ -92,9 +110,9 @@
     copy->_private->parent = [_private->parent copy];
     copy->_private->title = [_private->title copy];
     copy->_private->displayTitle = [_private->displayTitle copy];
+    copy->_private->lastVisitedTimeInterval = _private->lastVisitedTimeInterval;
     copy->_private->lastVisitedDate = [_private->lastVisitedDate copy];
     copy->_private->scrollPoint = _private->scrollPoint;
-    copy->_private->anchor = [_private->anchor copy];
     copy->_private->documentState = [_private->documentState copy];
     if (_private->subItems) {
         copy->_private->subItems = [[NSMutableArray alloc] initWithArray:_private->subItems copyItems:YES];
@@ -151,9 +169,9 @@
 }
 
 
-- (NSCalendarDate *)lastVisitedDate
+- (NSTimeInterval)lastVisitedTimeInterval
 {
-    return _private->lastVisitedDate;
+    return _private->lastVisitedTimeInterval;
 }
 
 - (unsigned)hash
@@ -161,11 +179,6 @@
     return [_private->URLString hash];
 }
 
-- (NSString *)anchor
-{
-    return _private->anchor;
-}
-
 - (BOOL)isEqual:(id)anObject
 {
     if (![anObject isMemberOfClass:[WebHistoryItem class]]) {
@@ -304,16 +317,24 @@
     _private->parent = copy;
 }
 
-- (void)setLastVisitedDate:(NSCalendarDate *)date
+- (void)_setLastVisitedTimeInterval:(NSTimeInterval)time
 {
-    if (date != _private->lastVisitedDate) {
-        if (![_private->lastVisitedDate isEqual:date]) {
-            _private->visitCount++;
-        }
-        [date retain];
+    if (_private->lastVisitedTimeInterval != time) {
+        _private->lastVisitedTimeInterval = time;
         [_private->lastVisitedDate release];
-        _private->lastVisitedDate = date;
+        _private->lastVisitedDate = nil;
+        _private->visitCount++;
+    }
+}
+
+// FIXME:  Remove this accessor and related ivar.
+- (NSCalendarDate *)_lastVisitedDate
+{
+    if (!_private->lastVisitedDate){
+        _private->lastVisitedDate = [[NSCalendarDate alloc]
+                    initWithTimeIntervalSinceReferenceDate:_private->lastVisitedTimeInterval];
     }
+    return _private->lastVisitedDate;
 }
 
 - (int)visitCount
@@ -348,13 +369,6 @@
     _private->scrollPoint = scrollPoint;
 }
 
-- (void)setAnchor:(NSString *)a
-{
-    NSString *copy = [a copy];
-    [_private->anchor release];
-    _private->anchor = copy;
-}
-
 - (BOOL)isTargetItem
 {
     return _private->isTargetItem;
@@ -471,17 +485,16 @@
         [dict setObject:_private->URLString forKey:@""];
     }
     if (_private->title) {
-        [dict setObject:_private->title forKey:@"title"];
+        [dict setObject:_private->title forKey:WebTitleKey];
     }
     if (_private->displayTitle) {
-        [dict setObject:_private->displayTitle forKey:@"displayTitle"];
+        [dict setObject:_private->displayTitle forKey:WebDisplayTitleKey];
     }
-    if (_private->lastVisitedDate) {
-        [dict setObject:[NSString stringWithFormat:@"%.1lf", [_private->lastVisitedDate timeIntervalSinceReferenceDate]]
-                 forKey:@"lastVisitedDate"];
+    if (_private->lastVisitedTimeInterval != 0.0) {
+        [dict _web_setDouble:_private->lastVisitedTimeInterval forKey:WebLastVisitedTimeIntervalKey];
     }
     if (_private->visitCount) {
-        [dict setObject:[NSNumber numberWithInt:_private->visitCount] forKey:@"visitCount"];
+        [dict setObject:[NSNumber numberWithInt:_private->visitCount] forKey:WebVisitCountKey];
     }
     if (_private->subItems != nil) {
         NSMutableArray *childDicts = [NSMutableArray arrayWithCapacity:[_private->subItems count]];
@@ -489,7 +502,7 @@
         for (i = [_private->subItems count]; i >= 0; i--) {
             [childDicts addObject: [[_private->subItems objectAtIndex:i] dictionaryRepresentation]];
         }
-        [dict setObject: childDicts forKey: @"children"];
+        [dict setObject: childDicts forKey:WebChildrenKey];
     }
 
     return dict;
@@ -498,23 +511,24 @@
 - (id)initFromDictionaryRepresentation:(NSDictionary *)dict
 {
     NSString *URLString = [dict _web_stringForKey:@""];
-    NSString *title = [dict _web_stringForKey:@"title"];
+    NSString *title = [dict _web_stringForKey:WebTitleKey];
 
     self = [self initWithURL:(URLString ? [NSURL _web_URLWithString:URLString] : nil) title:title];
 
-    [self setAlternateTitle:[dict _web_stringForKey:@"displayTitle"]];
+    [self setAlternateTitle:[dict _web_stringForKey:WebDisplayTitleKey]];
 
-    NSString *date = [dict _web_stringForKey:@"lastVisitedDate"];
-    if (date) {
-        NSCalendarDate *calendarDate = [[NSCalendarDate alloc]
-            initWithTimeIntervalSinceReferenceDate:[date doubleValue]];
-        [self setLastVisitedDate:calendarDate];
-        [calendarDate release];
+    // We used to store a string representation of the date.  If we can't
+    // find a time interval check for the presence of that old string.
+    _private->lastVisitedTimeInterval = [dict _web_doubleForKey:WebLastVisitedTimeIntervalKey];
+    if (_private->lastVisitedTimeInterval == 0.0){
+        NSString *date = [dict _web_stringForKey:WebOBSOLETELastVisitedDateKey];
+        if (date)
+            _private->lastVisitedTimeInterval = [date doubleValue];
     }
 
-    _private->visitCount = [dict _web_intForKey:@"visitCount"];
+    _private->visitCount = [dict _web_intForKey:WebVisitCountKey];
 
-    NSArray *childDicts = [dict objectForKey:@"children"];
+    NSArray *childDicts = [dict objectForKey:WebChildrenKey];
     if (childDicts) {
         _private->subItems = [[NSMutableArray alloc] initWithCapacity:[childDicts count]];
         int i;
diff --git a/WebKit/History.subproj/WebHistoryItemPrivate.h b/WebKit/History.subproj/WebHistoryItemPrivate.h
index eac1634..59a2a52 100644
--- a/WebKit/History.subproj/WebHistoryItemPrivate.h
+++ b/WebKit/History.subproj/WebHistoryItemPrivate.h
@@ -40,11 +40,9 @@
 - (void)setTarget:(NSString *)target;
 - (void)setParent:(NSString *)parent;
 - (void)setTitle:(NSString *)title;
-- (void)setLastVisitedDate:(NSCalendarDate *)date;
 - (void)setScrollPoint:(NSPoint)p;
 - (void)setDocumentState:(NSArray *)state;
 - (void)setIsTargetItem:(BOOL)flag;
-- (void)setAnchor:(NSString *)anchor;
 - (void)setFormData:(NSData *)data;
 - (void)setFormContentType:(NSString *)type;
 - (void)setFormReferrer:(NSString *)referrer;
@@ -58,6 +56,9 @@
 - (void)setAlwaysAttemptToUsePageCache: (BOOL)flag;
 - (BOOL)alwaysAttemptToUsePageCache;
 
+- (NSCalendarDate *)_lastVisitedDate;
+- (void)_setLastVisitedTimeInterval:(NSTimeInterval)time;
+
 @end
 
 @interface WebBackForwardList (WebPrivate)
diff --git a/WebKit/History.subproj/WebHistoryPrivate.m b/WebKit/History.subproj/WebHistoryPrivate.m
index aaf1d32..bb79ce0 100644
--- a/WebKit/History.subproj/WebHistoryPrivate.m
+++ b/WebKit/History.subproj/WebHistoryPrivate.m
@@ -96,12 +96,12 @@ NSString *DatesArrayKey = @"WebHistoryDates";
     ASSERT_ARG(dateIndex, dateIndex >= 0 && (uint)dateIndex < [_entriesByDate count]);
 
     //FIXME: just does linear search through entries; inefficient if many entries for this date
-    entryDate = [entry lastVisitedDate];
+    entryDate = [entry _lastVisitedDate];
     entriesForDate = [_entriesByDate objectAtIndex: dateIndex];
     count = [entriesForDate count];
     // optimized for inserting oldest to youngest
     for (index = 0; index < count; ++index) {
-        if ([entryDate compare: [[entriesForDate objectAtIndex: index] lastVisitedDate]] != NSOrderedAscending) {
+        if ([entryDate compare: [[entriesForDate objectAtIndex: index] _lastVisitedDate]] != NSOrderedAscending) {
             break;
         }
     }
@@ -123,7 +123,7 @@ NSString *DatesArrayKey = @"WebHistoryDates";
 
     [_entriesByURL removeObjectForKey: URLString];
 
-    foundDate = [self findIndex: &dateIndex forDay: [entry lastVisitedDate]];
+    foundDate = [self findIndex: &dateIndex forDay: [entry _lastVisitedDate]];
 
     ASSERT(foundDate);
     
@@ -145,7 +145,7 @@ NSString *DatesArrayKey = @"WebHistoryDates";
     int dateIndex;
     NSString *URLString;
 
-    ASSERT_ARG(entry, [entry lastVisitedDate] != nil);
+    ASSERT_ARG(entry, [entry _lastVisitedDate] != nil);
 
 #ifdef FIX_VISITED
     URLString = [[[entry URL] _web_canonicalize] absoluteString];
@@ -162,12 +162,12 @@ NSString *DatesArrayKey = @"WebHistoryDates";
 
     [self removeItemForURLString: URLString];
 
-    if ([self findIndex: &dateIndex forDay: [entry lastVisitedDate]]) {
+    if ([self findIndex: &dateIndex forDay: [entry _lastVisitedDate]]) {
         // other entries already exist for this date
         [self insertItem: entry atDateIndex: dateIndex];
     } else {
         // no other entries exist for this date
-        [_datesWithEntries insertObject: [entry lastVisitedDate] atIndex: dateIndex];
+        [_datesWithEntries insertObject: [entry _lastVisitedDate] atIndex: dateIndex];
         [_entriesByDate insertObject: [NSMutableArray arrayWithObject:entry] atIndex: dateIndex];
     }
 
@@ -405,7 +405,7 @@ NSString *DatesArrayKey = @"WebHistoryDates";
 
         entry = [[[WebHistoryItem alloc] initFromDictionaryRepresentation:itemAsDictionary] autorelease];
 
-        if ([entry URL] == nil || [entry lastVisitedDate] == nil) {
+        if ([entry URL] == nil) {
             // entry without URL is useless; data on disk must have been bad; ignore this one
             // entry without lastVisitDate should never happen; ignore that one
             continue;
@@ -413,7 +413,7 @@ NSString *DatesArrayKey = @"WebHistoryDates";
 
         // test against date limit
         if (!ageLimitPassed) {
-            if ([[entry lastVisitedDate] _web_compareDay:ageLimitDate] != NSOrderedDescending) {
+            if ([[entry _lastVisitedDate] _web_compareDay:ageLimitDate] != NSOrderedDescending) {
                 continue;
             } else {
                 ageLimitPassed = YES;
diff --git a/WebKit/Plugins.subproj/WebPluginDatabase.m b/WebKit/Plugins.subproj/WebPluginDatabase.m
index e58f7d1..1c65425 100644
--- a/WebKit/Plugins.subproj/WebPluginDatabase.m
+++ b/WebKit/Plugins.subproj/WebPluginDatabase.m
@@ -176,7 +176,7 @@ static NSArray *pluginLocations(void)
                 // Don't override previously registered types.
                 if(![viewTypes containsObject:mime]){
                     // Cocoa plugins must register themselves.
-                    [WebFrame registerViewClass:[WebNetscapePluginDocumentView class] representationClass:[WebNetscapePluginRepresentation class] forMIMEType:mime];
+                    [WebView registerViewClass:[WebNetscapePluginDocumentView class] representationClass:[WebNetscapePluginRepresentation class] forMIMEType:mime];
                 }
             }
         }
diff --git a/WebKit/WebKit.exp b/WebKit/WebKit.exp
index e492d62..ac16414 100644
--- a/WebKit/WebKit.exp
+++ b/WebKit/WebKit.exp
@@ -46,6 +46,7 @@ _WebHistoryItemsAddedNotification
 _WebHistoryItemsKey
 _WebHistoryItemsRemovedNotification
 _WebHistoryLoadedNotification
+_WebHistorySavedNotification
 _WebIconDatabaseDidAddIconNotification
 _WebIconLargeSize
 _WebIconMediumSize
diff --git a/WebKit/WebView.subproj/WebFrame.h b/WebKit/WebView.subproj/WebFrame.h
index 7d47184..661ae4b 100644
--- a/WebKit/WebView.subproj/WebFrame.h
+++ b/WebKit/WebView.subproj/WebFrame.h
@@ -131,17 +131,4 @@
 */
 - (NSArray *)childFrames;
 
-/*!
-    @method registerViewClass:representationClass:forMIMEType:
-    @discussion Register classes that implement WebDocumentView and WebDocumentRepresentation respectively.
-    A document class may register for a primary MIME type by excluding
-    a subtype, i.e. "video/" will match the document class with
-    all video types.  More specific matching takes precedence
-    over general matching.
-    @param viewClass The WebDocumentView class to use to render data for a given MIME type.
-    @param representationClass The WebDocumentRepresentation class to use to represent data of the given MIME type.
-    @param MIMEType The MIME type to represent with an object of the given class.
-*/
-+ (void)registerViewClass:(Class)viewClass representationClass: (Class)representationClass forMIMEType:(NSString *)MIMEType;
-
 @end
diff --git a/WebKit/WebView.subproj/WebFrame.m b/WebKit/WebView.subproj/WebFrame.m
index 3e53cf9..08d817d 100644
--- a/WebKit/WebView.subproj/WebFrame.m
+++ b/WebKit/WebView.subproj/WebFrame.m
@@ -219,10 +219,4 @@
     return [[_private->children copy] autorelease];
 }
 
-+ (void) registerViewClass:(Class)viewClass representationClass: (Class)representationClass forMIMEType:(NSString *)MIMEType
-{
-    [[WebFrameView _viewTypes] setObject:viewClass forKey:MIMEType];
-    [[WebDataSource _repTypes] setObject:representationClass forKey:MIMEType];
-}
-
 @end
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index 61af3c4..5e034ca 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -274,7 +274,6 @@ Repeat load of the same URL (by any other means of navigation other than the rel
     WebHistoryItem *bfItem;
 
     bfItem = [[[WebHistoryItem alloc] initWithURL:URL target:[self name] parent:[[self parentFrame] name] title:[dataSrc pageTitle]] autorelease];
-    [bfItem setAnchor:[URL fragment]];
     [dataSrc _addBackForwardItem:bfItem];
     [bfItem setOriginalURLString:[[[dataSrc _originalRequest] URL] absoluteString]];
 
@@ -658,7 +657,7 @@ Repeat load of the same URL (by any other means of navigation other than the rel
                 NSURL *URL = [[[ds _originalRequest] URL] _web_canonicalize];
                 WebHistoryItem *oldItem = [[WebHistory optionalSharedHistory] itemForURL:URL];
                 if (oldItem) {
-                    [oldItem setLastVisitedDate:[NSCalendarDate date]];
+                    [oldItem _setLastVisitedTimeInterval:[NSDate timeIntervalSinceReferenceDate]];
                 }
                 [self _makeDocumentView];
                 break;
@@ -1117,8 +1116,9 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
         // FIXME: form state might want to be saved here too
 
         // FIXME: Perhaps we can use scrollToAnchorWithURL here instead and remove the older scrollToAnchor:?
-        if ([item anchor])
-            [[_private->dataSource _bridge] scrollToAnchor: [item anchor]];
+        NSString *anchor = [[item URLString] _web_URLFragment];
+        if (anchor)
+            [[_private->dataSource _bridge] scrollToAnchor: anchor];
     
         // must do this maintenance here, since we don't go through a real page reload
         [_private setCurrentItem:item];
diff --git a/WebKit/WebView.subproj/WebView.h b/WebKit/WebView.subproj/WebView.h
index 9f2b650..80a80a7 100644
--- a/WebKit/WebView.subproj/WebView.h
+++ b/WebKit/WebView.subproj/WebView.h
@@ -342,6 +342,20 @@ extern NSString *WebElementLinkLabelKey;	// NSString of the text within the anch
 */
 - (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag;
 
+/*!
+    @method registerViewClass:representationClass:forMIMEType:
+    @discussion Register classes that implement WebDocumentView and WebDocumentRepresentation respectively.
+    A document class may register for a primary MIME type by excluding
+    a subtype, i.e. "video/" will match the document class with
+    all video types.  More specific matching takes precedence
+    over general matching.
+    @param viewClass The WebDocumentView class to use to render data for a given MIME type.
+    @param representationClass The WebDocumentRepresentation class to use to represent data of the given MIME type.
+    @param MIMEType The MIME type to represent with an object of the given class.
+*/
++ (void)registerViewClass:(Class)viewClass representationClass: (Class)representationClass forMIMEType:(NSString *)MIMEType;
+
+
 @end
 
 
diff --git a/WebKit/WebView.subproj/WebView.m b/WebKit/WebView.subproj/WebView.m
index 25c5b72..e06455c 100644
--- a/WebKit/WebView.subproj/WebView.m
+++ b/WebKit/WebView.subproj/WebView.m
@@ -574,6 +574,13 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
     return NO;
 }
 
++ (void) registerViewClass:(Class)viewClass representationClass: (Class)representationClass forMIMEType:(NSString *)MIMEType
+{
+    [[WebFrameView _viewTypes] setObject:viewClass forKey:MIMEType];
+    [[WebDataSource _repTypes] setObject:representationClass forKey:MIMEType];
+}
+
+
 @end
 
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list