[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 06:36:38 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit c93c3ed6d6bbc151fc9669f8a84c8307e8a9813d
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Sep 6 02:29:57 2002 +0000
Add the first child text node of the element to the
element dictionary. This will be used as a link 'label'.
* kwq/WebCoreBridge.h:
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge elementAtPoint:]):
Use the first text child node of the link element
as the title for a dragged link. We'll use this for
the dragged image later too.
* WebView.subproj/WebController.h:
* WebView.subproj/WebController.m:
* WebView.subproj/WebHTMLView.m:
(-[WebHTMLView mouseDragged:]):
* WebView.subproj/WebHTMLViewPrivate.m:
(-[WebHTMLView _elementAtPoint:]):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1978 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index a5013f6..0eb4429 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,4 +1,13 @@
2002-09-05 Richard Williamson (Local) <rjw at apple.com>
+
+ Add the first child text node of the element to the
+ element dictionary. This will be used as a link 'label'.
+
+ * kwq/WebCoreBridge.h:
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge elementAtPoint:]):
+
+2002-09-05 Richard Williamson (Local) <rjw at apple.com>
Removed debugging.
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index a5013f6..0eb4429 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,4 +1,13 @@
2002-09-05 Richard Williamson (Local) <rjw at apple.com>
+
+ Add the first child text node of the element to the
+ element dictionary. This will be used as a link 'label'.
+
+ * kwq/WebCoreBridge.h:
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge elementAtPoint:]):
+
+2002-09-05 Richard Williamson (Local) <rjw at apple.com>
Removed debugging.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index a5013f6..0eb4429 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,4 +1,13 @@
2002-09-05 Richard Williamson (Local) <rjw at apple.com>
+
+ Add the first child text node of the element to the
+ element dictionary. This will be used as a link 'label'.
+
+ * kwq/WebCoreBridge.h:
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge elementAtPoint:]):
+
+2002-09-05 Richard Williamson (Local) <rjw at apple.com>
Removed debugging.
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index b0f7a0b..6564ad6 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -54,6 +54,7 @@ typedef khtml::RenderPart KHTMLRenderPart;
@protocol WebCoreResourceLoader;
#define WebCoreContextLinkURL @"WebContextLinkURL"
+#define WebCoreContextLinkLabel @"WebContextLinkLabel"
#define WebCoreContextImageURL @"WebContextImageURL"
#define WebCoreContextString @"WebContextString"
#define WebCoreContextImage @"WebContextImage"
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index a3e5445..59b9295 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -435,6 +435,21 @@ using khtml::RenderPart;
ElementImpl* e = static_cast<ElementImpl*>(URLNode);
NSURL *URL = [self completeURLForDOMString:parseURL(e->getAttribute(ATTR_HREF))];
if (URL) {
+ // Look for the first #text node to use as a label.
+ NodeImpl *labelParent = e;
+ while (labelParent->hasChildNodes()){
+ NodeImpl *childNode = labelParent->firstChild();
+ unsigned short type = childNode->nodeType();
+ if (type == Node::TEXT_NODE){
+ DOMStringImpl *dv = childNode->nodeValue().implementation();
+ if (dv){
+ NSString *value = [NSString stringWithCharacters: (const unichar *)dv->s length: dv->l];
+ [elementInfo setObject:value forKey:WebCoreContextLinkLabel];
+ break;
+ }
+ }
+ labelParent = childNode;
+ }
[elementInfo setObject:URL forKey:WebCoreContextLinkURL];
}
}
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 839a67d..667db7e 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,18 @@
2002-09-05 Richard Williamson (Local) <rjw at apple.com>
+ Use the first text child node of the link element
+ as the title for a dragged link. We'll use this for
+ the dragged image later too.
+
+ * WebView.subproj/WebController.h:
+ * WebView.subproj/WebController.m:
+ * WebView.subproj/WebHTMLView.m:
+ (-[WebHTMLView mouseDragged:]):
+ * WebView.subproj/WebHTMLViewPrivate.m:
+ (-[WebHTMLView _elementAtPoint:]):
+
+2002-09-05 Richard Williamson (Local) <rjw at apple.com>
+
Correctly save of document state in current
document when going back.
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 839a67d..667db7e 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,5 +1,18 @@
2002-09-05 Richard Williamson (Local) <rjw at apple.com>
+ Use the first text child node of the link element
+ as the title for a dragged link. We'll use this for
+ the dragged image later too.
+
+ * WebView.subproj/WebController.h:
+ * WebView.subproj/WebController.m:
+ * WebView.subproj/WebHTMLView.m:
+ (-[WebHTMLView mouseDragged:]):
+ * WebView.subproj/WebHTMLViewPrivate.m:
+ (-[WebHTMLView _elementAtPoint:]):
+
+2002-09-05 Richard Williamson (Local) <rjw at apple.com>
+
Correctly save of document state in current
document when going back.
diff --git a/WebKit/WebView.subproj/WebController.h b/WebKit/WebView.subproj/WebController.h
index c4bbb0f..f998c89 100644
--- a/WebKit/WebView.subproj/WebController.h
+++ b/WebKit/WebView.subproj/WebController.h
@@ -108,6 +108,7 @@
// These strings are keys into the element dictionary provided in
// contextMenuItemsForElement.
extern NSString *WebContextMenuElementLinkURLKey;
+extern NSString *WebContextMenuElementLinkLabelKey;
extern NSString *WebContextMenuElementImageURLKey;
extern NSString *WebContextMenuElementStringKey;
extern NSString *WebContextMenuElementImageKey;
diff --git a/WebKit/WebView.subproj/WebController.m b/WebKit/WebView.subproj/WebController.m
index c9868c0..df5e43b 100644
--- a/WebKit/WebView.subproj/WebController.m
+++ b/WebKit/WebView.subproj/WebController.m
@@ -26,6 +26,7 @@
#import <WebFoundation/WebFoundation.h>
NSString * WebContextMenuElementLinkURLKey = @"WebContextLinkURL";
+NSString * WebContextMenuElementLinkLabelKey = @"WebContextLinkLabel";
NSString * WebContextMenuElementImageURLKey = @"WebContextImageURL";
NSString * WebContextMenuElementStringKey = @"WebContextString";
NSString * WebContextMenuElementImageKey = @"WebContextImage";
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index daf8682..ebeb095 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -20,6 +20,7 @@
#import <WebKit/WebTextRenderer.h>
#import <WebKit/WebTextRendererFactory.h>
#import <WebKit/WebViewPrivate.h>
+#import <WebKit/WebURLsWithTitles.h>
#import <WebFoundation/WebAssertions.h>
@@ -442,10 +443,18 @@
}
else if (linkURL) {
_private->draggedURL = linkURL;
- NSPasteboard *pasteboard = [NSPasteboard pasteboardWithName:NSDragPboard];
+
+ NSString *label = [element objectForKey: WebContextMenuElementLinkLabelKey];
- [pasteboard declareTypes:[NSArray arrayWithObject:NSURLPboardType] owner:nil];
- [_private->draggedURL writeToPasteboard: pasteboard];
+ if (!label)
+ label = [linkURL absoluteString];
+
+ // FIXME: Create an image w/ the label.
+
+ 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];
+ //[_private->draggedURL writeToPasteboard: pasteboard];
NSSize offset = WebIconSmallSize;
offset.width /= 2;
offset.height /= 2;
diff --git a/WebKit/WebView.subproj/WebHTMLViewPrivate.m b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
index 3777397..28db8cb 100644
--- a/WebKit/WebView.subproj/WebHTMLViewPrivate.m
+++ b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
@@ -106,15 +106,7 @@ BOOL _modifierTrackingEnabled = FALSE;
NSDictionary *elementInfoWC = [[self _bridge] elementAtPoint:point];
NSMutableDictionary *elementInfo = [NSMutableDictionary dictionary];
- NSURL *linkURL = [elementInfoWC objectForKey:WebContextMenuElementLinkURLKey];
- NSURL *imageURL = [elementInfoWC objectForKey:WebContextMenuElementImageURLKey];
- NSString *string = [elementInfoWC objectForKey:WebContextMenuElementStringKey];
- NSImage *image = [elementInfoWC objectForKey:WebContextMenuElementImageKey];
-
- if(linkURL) [elementInfo setObject:linkURL forKey:WebContextMenuElementLinkURLKey];
- if(imageURL) [elementInfo setObject:imageURL forKey:WebContextMenuElementImageURLKey];
- if(string) [elementInfo setObject:string forKey:WebContextMenuElementStringKey];
- if(image) [elementInfo setObject:image forKey:WebContextMenuElementImageKey];
+ [elementInfo addEntriesFromDictionary: elementInfoWC];
WebView *webView = [self _web_parentWebView];
WebFrame *webFrame = [[webView _controller] frameForView:webView];
diff --git a/WebKit/WebView.subproj/WebView.h b/WebKit/WebView.subproj/WebView.h
index c4bbb0f..f998c89 100644
--- a/WebKit/WebView.subproj/WebView.h
+++ b/WebKit/WebView.subproj/WebView.h
@@ -108,6 +108,7 @@
// These strings are keys into the element dictionary provided in
// contextMenuItemsForElement.
extern NSString *WebContextMenuElementLinkURLKey;
+extern NSString *WebContextMenuElementLinkLabelKey;
extern NSString *WebContextMenuElementImageURLKey;
extern NSString *WebContextMenuElementStringKey;
extern NSString *WebContextMenuElementImageKey;
diff --git a/WebKit/WebView.subproj/WebView.m b/WebKit/WebView.subproj/WebView.m
index c9868c0..df5e43b 100644
--- a/WebKit/WebView.subproj/WebView.m
+++ b/WebKit/WebView.subproj/WebView.m
@@ -26,6 +26,7 @@
#import <WebFoundation/WebFoundation.h>
NSString * WebContextMenuElementLinkURLKey = @"WebContextLinkURL";
+NSString * WebContextMenuElementLinkLabelKey = @"WebContextLinkLabel";
NSString * WebContextMenuElementImageURLKey = @"WebContextImageURL";
NSString * WebContextMenuElementStringKey = @"WebContextString";
NSString * WebContextMenuElementImageKey = @"WebContextImage";
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list