[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
darin
darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:36:50 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit ab4d86512f0ae02e4269f7a1586801b5c7871970
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Sep 6 20:34:56 2002 +0000
Fix some minor anomalies and leaks.
* History.subproj/WebHistoryItem.m:
(-[WebHistoryItem initWithURL:target:parent:title:]): Use copy, not retain.
(-[WebHistoryItem dealloc]): Release the anchor, fix leak.
(-[WebHistoryItem setURL:]): Check for URLs that are equal, not just ==.
(-[WebHistoryItem setTitle:]): Copy, not retain.
(-[WebHistoryItem setTarget:]): Copy, not retain.
(-[WebHistoryItem setParent:]): Copy, not retain.
(-[WebHistoryItem setDisplayTitle:]): Copy, not retain.
(-[WebHistoryItem setAnchor:]): Copy, not retain.
* WebView.subproj/WebControllerPolicyHandler.m:
(-[WebPolicyPrivate dealloc]): Release the URL, call super, fix leaks.
(-[WebPolicy _setPath:]): Use copy, not retain.
* WebView.subproj/WebControllerPrivate.m:
(-[WebControllerPrivate dealloc]): Release downloadProgressHandler,
contextMenuHandler, locationChangeHandler, fix leaks.
Some fun with Richard's new code.
* WebView.subproj/WebHTMLView.m:
(-[WebHTMLView mouseDragged:]): Center image around mouse instead of
putting it up and to the right. Add more X space than Y space.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1985 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index de4f34b..3a0a551 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,29 @@
+2002-09-06 Darin Adler <darin at apple.com>
+
+ Fix some minor anomalies and leaks.
+
+ * History.subproj/WebHistoryItem.m:
+ (-[WebHistoryItem initWithURL:target:parent:title:]): Use copy, not retain.
+ (-[WebHistoryItem dealloc]): Release the anchor, fix leak.
+ (-[WebHistoryItem setURL:]): Check for URLs that are equal, not just ==.
+ (-[WebHistoryItem setTitle:]): Copy, not retain.
+ (-[WebHistoryItem setTarget:]): Copy, not retain.
+ (-[WebHistoryItem setParent:]): Copy, not retain.
+ (-[WebHistoryItem setDisplayTitle:]): Copy, not retain.
+ (-[WebHistoryItem setAnchor:]): Copy, not retain.
+ * WebView.subproj/WebControllerPolicyHandler.m:
+ (-[WebPolicyPrivate dealloc]): Release the URL, call super, fix leaks.
+ (-[WebPolicy _setPath:]): Use copy, not retain.
+ * WebView.subproj/WebControllerPrivate.m:
+ (-[WebControllerPrivate dealloc]): Release downloadProgressHandler,
+ contextMenuHandler, locationChangeHandler, fix leaks.
+
+ Some fun with Richard's new code.
+
+ * WebView.subproj/WebHTMLView.m:
+ (-[WebHTMLView mouseDragged:]): Center image around mouse instead of
+ putting it up and to the right. Add more X space than Y space.
+
2002-09-06 Richard Williamson (Home) <rjw at apple.com>
* WebView.subproj/WebHTMLView.m:
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index de4f34b..3a0a551 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,29 @@
+2002-09-06 Darin Adler <darin at apple.com>
+
+ Fix some minor anomalies and leaks.
+
+ * History.subproj/WebHistoryItem.m:
+ (-[WebHistoryItem initWithURL:target:parent:title:]): Use copy, not retain.
+ (-[WebHistoryItem dealloc]): Release the anchor, fix leak.
+ (-[WebHistoryItem setURL:]): Check for URLs that are equal, not just ==.
+ (-[WebHistoryItem setTitle:]): Copy, not retain.
+ (-[WebHistoryItem setTarget:]): Copy, not retain.
+ (-[WebHistoryItem setParent:]): Copy, not retain.
+ (-[WebHistoryItem setDisplayTitle:]): Copy, not retain.
+ (-[WebHistoryItem setAnchor:]): Copy, not retain.
+ * WebView.subproj/WebControllerPolicyHandler.m:
+ (-[WebPolicyPrivate dealloc]): Release the URL, call super, fix leaks.
+ (-[WebPolicy _setPath:]): Use copy, not retain.
+ * WebView.subproj/WebControllerPrivate.m:
+ (-[WebControllerPrivate dealloc]): Release downloadProgressHandler,
+ contextMenuHandler, locationChangeHandler, fix leaks.
+
+ Some fun with Richard's new code.
+
+ * WebView.subproj/WebHTMLView.m:
+ (-[WebHTMLView mouseDragged:]): Center image around mouse instead of
+ putting it up and to the right. Add more X space than Y space.
+
2002-09-06 Richard Williamson (Home) <rjw at apple.com>
* WebView.subproj/WebHTMLView.m:
diff --git a/WebKit/History.subproj/WebHistoryItem.m b/WebKit/History.subproj/WebHistoryItem.m
index ec581ed..d6b4342 100644
--- a/WebKit/History.subproj/WebHistoryItem.m
+++ b/WebKit/History.subproj/WebHistoryItem.m
@@ -48,9 +48,9 @@
}
_URL = [URL retain];
- _target = [target retain];
- _parent = [parent retain];
- _title = [title retain];
+ _target = [target copy];
+ _parent = [parent copy];
+ _title = [title copy];
_lastVisitedDate = [[NSCalendarDate alloc] init];
[self _retainIconInDatabase:YES];
@@ -69,6 +69,7 @@
[_displayTitle release];
[_icon release];
[_lastVisitedDate release];
+ [anchor release];
[_documentState release];
[super dealloc];
@@ -125,7 +126,7 @@
-(void)setURL:(NSURL *)URL
{
- if (URL != _URL) {
+ if (!(URL == _URL || [URL isEqual:_URL])) {
[self _retainIconInDatabase:NO];
[_URL release];
_URL = [URL retain];
@@ -136,49 +137,44 @@
-(void)setTitle:(NSString *)title
{
- if (title != _title) {
- [_title release];
- _title = [title retain];
- }
+ NSString *copy = [title copy];
+ [_title release];
+ _title = copy;
}
-(void)setTarget:(NSString *)target
{
- if (target != _target) {
- [_target release];
- _target = [target retain];
- }
+ NSString *copy = [target copy];
+ [_target release];
+ _target = copy;
}
-(void)setParent:(NSString *)parent
{
- if (parent != _parent) {
- [_parent release];
- _parent = [parent retain];
- }
+ NSString *copy = [parent copy];
+ [_parent release];
+ _parent = copy;
}
-(void)setDisplayTitle:(NSString *)displayTitle
{
- if (displayTitle != _displayTitle) {
- [_displayTitle release];
- _displayTitle = [displayTitle retain];
- }
+ NSString *copy = [displayTitle copy];
+ [_displayTitle release];
+ _displayTitle = copy;
}
-(void)setLastVisitedDate:(NSCalendarDate *)date
{
- if (date != _lastVisitedDate) {
- [_lastVisitedDate release];
- _lastVisitedDate = [date retain];
- }
+ [date retain];
+ [_lastVisitedDate release];
+ _lastVisitedDate = date;
}
-- (void)setDocumentState: (NSArray *)state;
+- (void)setDocumentState:(NSArray *)state;
{
- [state retain];
+ NSArray *copy = [state copy];
[_documentState release];
- _documentState = state;
+ _documentState = copy;
}
- (NSArray *)documentState
@@ -208,9 +204,9 @@
- (void)setAnchor: (NSString *)a
{
- [a retain];
+ NSString *copy = [a copy];
[anchor release];
- anchor = a;
+ anchor = copy;
}
diff --git a/WebKit/Plugins.subproj/WebPluginStream.m b/WebKit/Plugins.subproj/WebPluginStream.m
index 39ba756..58e6042 100644
--- a/WebKit/Plugins.subproj/WebPluginStream.m
+++ b/WebKit/Plugins.subproj/WebPluginStream.m
@@ -189,8 +189,10 @@
{
// Don't report error before we've called NPP_NewStream
if(!isFirstChunk){
- NPError npErr;
- npErr = NPP_DestroyStream(instance, &npStream, error);
+#ifndef NDEBUG
+ NPError npErr =
+#endif
+ NPP_DestroyStream(instance, &npStream, error);
WEBKITDEBUGLEVEL(WEBKIT_LOG_PLUGINS, "NPP_DestroyStream: %d", npErr);
}
}
diff --git a/WebKit/WebView.subproj/WebControllerPolicyHandler.m b/WebKit/WebView.subproj/WebControllerPolicyHandler.m
index c3794ac..8e409fb 100644
--- a/WebKit/WebView.subproj/WebControllerPolicyHandler.m
+++ b/WebKit/WebView.subproj/WebControllerPolicyHandler.m
@@ -22,17 +22,20 @@
- (void)dealloc
{
[path release];
+ [URL release];
+ [super dealloc];
}
@end
@implementation WebPolicy
+
- initWithPolicyAction: (WebPolicyAction)action URL:(NSURL *)URL andPath:(NSString *)path;
{
[super init];
_private = [[WebPolicyPrivate alloc] init];
_private->policyAction = action;
- _private->path = [path retain];
+ _private->path = [path copy];
_private->URL = [URL retain];
return self;
}
@@ -59,8 +62,9 @@
- (void)_setPath:(NSString *)path
{
+ NSString *copy = [path copy];
[_private->path release];
- _private->path = [path retain];
+ _private->path = copy;
}
@@ -107,5 +111,4 @@
return [[[WebPolicy alloc] initWithPolicyAction:action URL:URL andPath:thePath] autorelease];
}
-
@end
diff --git a/WebKit/WebView.subproj/WebControllerPrivate.m b/WebKit/WebView.subproj/WebControllerPrivate.m
index 8fd4663..92da62c 100644
--- a/WebKit/WebView.subproj/WebControllerPrivate.m
+++ b/WebKit/WebView.subproj/WebControllerPrivate.m
@@ -57,12 +57,16 @@
[self _clearControllerReferences: mainFrame];
[mainFrame reset];
+
[mainFrame release];
[windowContext release];
[resourceProgressHandler release];
+ [downloadProgressHandler release];
+ [contextMenuHandler release];
+ [defaultContextMenuHandler release];
[policyHandler release];
+ [locationChangeHandler release];
[backForwardList release];
- [defaultContextMenuHandler release];
[applicationNameForUserAgent release];
[userAgentOverride release];
[userAgentLock release];
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index 789b1c3..e74dc62 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -417,7 +417,8 @@
#define DragStartXHysteresis 2.0
#define DragStartYHysteresis 1.0
-#define DRAG_LABEL_BORDER 2.0
+#define DRAG_LABEL_BORDER_X 4.0
+#define DRAG_LABEL_BORDER_Y 2.0
- (void)mouseDragged:(NSEvent *)event
{
@@ -464,44 +465,47 @@
NSDictionary *urlAttributes = [NSDictionary dictionaryWithObject:urlFont forKey: NSFontAttributeName];
NSSize labelSize = [label sizeWithAttributes: labelAttributes];
NSSize imageSize, urlStringSize;
- imageSize.width += labelSize.width + DRAG_LABEL_BORDER*2;
- imageSize.height += labelSize.height + DRAG_LABEL_BORDER*2;
+ imageSize.width += labelSize.width + DRAG_LABEL_BORDER_X * 2;
+ imageSize.height += labelSize.height + DRAG_LABEL_BORDER_Y *2;
if (drawURLString){
urlStringSize = [urlString sizeWithAttributes: urlAttributes];
imageSize.height += urlStringSize.height;
// Clip the url string to 2.5 times the width of the label.
if (urlStringSize.width > 2.5 * labelSize.width){
- imageSize.width = (labelSize.width*2.5)+DRAG_LABEL_BORDER*2;
+ imageSize.width = (labelSize.width * 2.5) + DRAG_LABEL_BORDER_X * 2;
clipURLString = YES;
}
else
- imageSize.width = MAX(labelSize.width+DRAG_LABEL_BORDER*2,urlStringSize.width+DRAG_LABEL_BORDER*2);
+ imageSize.width = MAX(labelSize.width + DRAG_LABEL_BORDER_X * 2, urlStringSize.width + DRAG_LABEL_BORDER_X * 2);
}
NSImage *dragImage = [[[NSImage alloc] initWithSize: imageSize] autorelease];
[dragImage lockFocus];
[[NSColor colorWithCalibratedRed: 0.75 green: 0.75 blue: 1.0 alpha: 0.75] set];
[NSBezierPath fillRect:NSMakeRect(0, 0, imageSize.width, imageSize.height)];
if (drawURLString){
- urlString = [WebStringTruncator rightTruncateString: urlString toWidth: imageSize.width-2.0 withFont: urlFont];
- [urlString drawAtPoint: NSMakePoint (DRAG_LABEL_BORDER,DRAG_LABEL_BORDER) withAttributes: urlAttributes];
+ if (clipURLString) {
+ urlString = [WebStringTruncator rightTruncateString: urlString toWidth:imageSize.width - (DRAG_LABEL_BORDER_X * 2) withFont:urlFont];
+ }
+ [urlString drawAtPoint: NSMakePoint(DRAG_LABEL_BORDER_X, DRAG_LABEL_BORDER_Y) withAttributes: urlAttributes];
}
- [label drawAtPoint: NSMakePoint (DRAG_LABEL_BORDER,DRAG_LABEL_BORDER+urlStringSize.height) withAttributes: labelAttributes];
+ [label drawAtPoint: NSMakePoint (DRAG_LABEL_BORDER_X, DRAG_LABEL_BORDER_Y + urlStringSize.height) withAttributes: labelAttributes];
[dragImage unlockFocus];
NSPasteboard *pasteboard = [NSPasteboard pasteboardWithName:NSDragPboard];
[pasteboard declareTypes:[NSArray arrayWithObjects:NSURLPboardType, WebURLsWithTitlesPboardType, nil] owner:nil];
- [WebURLsWithTitles writeURLs:[NSArray arrayWithObjects: linkURL, nil] andTitles:[NSArray arrayWithObjects: label, nil] toPasteboard:pasteboard];
+ [WebURLsWithTitles writeURLs:[NSArray arrayWithObject:linkURL] andTitles:[NSArray arrayWithObject:label] toPasteboard:pasteboard];
+
+ NSPoint mousePoint = [self convertPoint:[event locationInWindow] fromView:nil];
+ NSSize centerOffset = NSMakeSize(imageSize.width / 2, -imageSize.height / 2);
+ NSPoint imagePoint = NSMakePoint(mousePoint.x - centerOffset.width, mousePoint.y - centerOffset.height);
- NSSize offset;
- offset.width = 0;
- offset.height = 0;
[self dragImage:dragImage
- at:[self convertPoint:[event locationInWindow] fromView:nil]
- offset:offset
- event:event
- pasteboard:pasteboard
- source:self
- slideBack:NO];
+ at:imagePoint
+ offset:centerOffset
+ event:event
+ pasteboard:pasteboard
+ source:self
+ slideBack:NO];
}
else
_private->draggedURL = nil;
diff --git a/WebKit/WebView.subproj/WebViewPrivate.m b/WebKit/WebView.subproj/WebViewPrivate.m
index 8fd4663..92da62c 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.m
+++ b/WebKit/WebView.subproj/WebViewPrivate.m
@@ -57,12 +57,16 @@
[self _clearControllerReferences: mainFrame];
[mainFrame reset];
+
[mainFrame release];
[windowContext release];
[resourceProgressHandler release];
+ [downloadProgressHandler release];
+ [contextMenuHandler release];
+ [defaultContextMenuHandler release];
[policyHandler release];
+ [locationChangeHandler release];
[backForwardList release];
- [defaultContextMenuHandler release];
[applicationNameForUserAgent release];
[userAgentOverride release];
[userAgentLock release];
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list