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

cblu cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:51:58 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 38bdefdd89b17fb0b4058767636133f7f9e1addd
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jul 20 22:27:27 2004 +0000

    WebCore:
    
    	Fixed:
    	<rdar://problem/3580589> REGRESSION (1.1-1.2): can't open a new window for an image that has not loaded
    	<rdar://problem/3612691> Missing image icons (blue ?) lack context menu
    
            Reviewed by john.
    
            * kwq/WebCoreBridge.mm:
            (-[WebCoreBridge elementAtPoint:]): if there is no image, put the image URL on the element anyway
    
    WebKit:
    
    	Fixed:
    	<rdar://problem/3580589> REGRESSION (1.1-1.2): can't open a new window for an image that has not loaded
    	<rdar://problem/3612691> Missing image icons (blue ?) lack context menu
    
            Reviewed by john.
    
            * WebView.subproj/WebDefaultContextMenuDelegate.m:
            (-[WebDefaultUIDelegate webView:contextMenuItemsForElement:defaultMenuItems:]): if there is no image, but there is an image URL, provide image context menu items besides "Copy Image"
            * WebView.subproj/WebHTMLView.m:
            (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): don't drag an image with an actual image
            (-[WebHTMLView _mayStartDragAtEventLocation:]): ditto
    
    WebBrowser:
    
    	Fixed:
    	<rdar://problem/3580589> REGRESSION (1.1-1.2): can't open a new window for an image that has not loaded
    	<rdar://problem/3612691> Missing image icons (blue ?) lack context menu
    
            Reviewed by john.
    
            * ContextMenuHandler.m:
            (-[BrowserWebView webView:contextMenuItemsForElement:defaultMenuItems:]): if there is no image, but there is an image URL, provide image context menu items besides copy and save menu items.
            * WebBrowser.pbproj/project.pbxproj:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@7072 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 77164e7..e325879 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,14 @@
+2004-07-20  Chris Blumenberg  <cblu at apple.com>
+
+	Fixed:
+	<rdar://problem/3580589> REGRESSION (1.1-1.2): can't open a new window for an image that has not loaded
+	<rdar://problem/3612691> Missing image icons (blue ?) lack context menu
+
+        Reviewed by john.
+
+        * kwq/WebCoreBridge.mm:
+        (-[WebCoreBridge elementAtPoint:]): if there is no image, put the image URL on the element anyway
+
 2004-07-20  David Hyatt  <hyatt at apple.com>
 
 	Fix for alt text not working on images.
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index 321c496..418f8b9 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -989,38 +989,38 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
             // Only return image information if there is an image.
             if (image && !r->isDisplayingError()) {
                 [element setObject:r->pixmap().image() forKey:WebCoreElementImageKey];
+            }
                 
-                int x, y;
-                if (r->absolutePosition(x, y)) {
-                    NSValue *rect = [NSValue valueWithRect:NSMakeRect(x, y, r->contentWidth(), r->contentHeight())];
-                    [element setObject:rect forKey:WebCoreElementImageRectKey];
-                }
-                
-                ElementImpl *i = static_cast<ElementImpl*>(node);
-        
-                // FIXME: Code copied from RenderImage::updateFromElement; should share.
-                DOMString attr;
-                if (idFromNode(i) == ID_OBJECT) {
-                    attr = i->getAttribute(ATTR_DATA);
-                } else {
-                    attr = i->getAttribute(ATTR_SRC);
-                }
-                if (!attr.isEmpty()) {
-                    QString URLString = parseURL(attr).string();
-                    [element setObject:_part->xmlDocImpl()->completeURL(URLString).getNSString() forKey:WebCoreElementImageURLKey];
-                }
+            int x, y;
+            if (r->absolutePosition(x, y)) {
+                NSValue *rect = [NSValue valueWithRect:NSMakeRect(x, y, r->contentWidth(), r->contentHeight())];
+                [element setObject:rect forKey:WebCoreElementImageRectKey];
+            }
                 
-                // FIXME: Code copied from RenderImage::updateFromElement; should share.
-                DOMString alt;
-                if (idFromNode(i) == ID_INPUT)
-                    alt = static_cast<HTMLInputElementImpl *>(i)->altText();
-                else if (idFromNode(i) == ID_IMG)
-                    alt = static_cast<HTMLImageElementImpl *>(i)->altText();
-                if (!alt.isNull()) {
-                    QString altText = alt.string();
-                    altText.replace('\\', _part->backslashAsCurrencySymbol());
-                    [element setObject:altText.getNSString() forKey:WebCoreElementImageAltStringKey];
-                }
+            ElementImpl *i = static_cast<ElementImpl*>(node);
+    
+            // FIXME: Code copied from RenderImage::updateFromElement; should share.
+            DOMString attr;
+            if (idFromNode(i) == ID_OBJECT) {
+                attr = i->getAttribute(ATTR_DATA);
+            } else {
+                attr = i->getAttribute(ATTR_SRC);
+            }
+            if (!attr.isEmpty()) {
+                QString URLString = parseURL(attr).string();
+                [element setObject:_part->xmlDocImpl()->completeURL(URLString).getNSString() forKey:WebCoreElementImageURLKey];
+            }
+            
+            // FIXME: Code copied from RenderImage::updateFromElement; should share.
+            DOMString alt;
+            if (idFromNode(i) == ID_INPUT)
+                alt = static_cast<HTMLInputElementImpl *>(i)->altText();
+            else if (idFromNode(i) == ID_IMG)
+                alt = static_cast<HTMLImageElementImpl *>(i)->altText();
+            if (!alt.isNull()) {
+                QString altText = alt.string();
+                altText.replace('\\', _part->backslashAsCurrencySymbol());
+                [element setObject:altText.getNSString() forKey:WebCoreElementImageAltStringKey];
             }
         }
     }
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 0d86691..54e3d7a 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,17 @@
+2004-07-20  Chris Blumenberg  <cblu at apple.com>
+
+	Fixed:
+	<rdar://problem/3580589> REGRESSION (1.1-1.2): can't open a new window for an image that has not loaded
+	<rdar://problem/3612691> Missing image icons (blue ?) lack context menu
+
+        Reviewed by john.
+
+        * WebView.subproj/WebDefaultContextMenuDelegate.m:
+        (-[WebDefaultUIDelegate webView:contextMenuItemsForElement:defaultMenuItems:]): if there is no image, but there is an image URL, provide image context menu items besides "Copy Image" 
+        * WebView.subproj/WebHTMLView.m:
+        (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): don't drag an image with an actual image
+        (-[WebHTMLView _mayStartDragAtEventLocation:]): ditto
+
 2004-07-20  Maciej Stachowiak  <mjs at apple.com>
 
         Reviewed by Chris.
@@ -246,7 +260,6 @@
         (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]):
 	Ask for slideback.
 
->>>>>>> 1.2612
 2004-07-02  Darin Adler  <darin at apple.com>
 
         Reviewed by Dave.
diff --git a/WebKit/WebView.subproj/WebDefaultContextMenuDelegate.m b/WebKit/WebView.subproj/WebDefaultContextMenuDelegate.m
index c23a5a8..27f9a03 100644
--- a/WebKit/WebView.subproj/WebDefaultContextMenuDelegate.m
+++ b/WebKit/WebView.subproj/WebDefaultContextMenuDelegate.m
@@ -122,7 +122,9 @@
         }
         [menuItems addObject:[self menuItemWithTag:WebMenuItemTagOpenImageInNewWindow]];
         [menuItems addObject:[self menuItemWithTag:WebMenuItemTagDownloadImageToDisk]];
-        [menuItems addObject:[self menuItemWithTag:WebMenuItemTagCopyImageToClipboard]];
+        if ([element objectForKey:WebElementImageURLKey] != nil) {
+            [menuItems addObject:[self menuItemWithTag:WebMenuItemTagCopyImageToClipboard]];
+        }
     }
     
     if (!imageURL && !linkURL) {
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index 4532eeb..8d7509d 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -811,14 +811,15 @@ static WebHTMLView *lastHitView = nil;
     
     WebView *webView = [self _webView];
     NSPasteboard *pasteboard = [NSPasteboard pasteboardWithName:NSDragPboard];
+    WebImageRenderer *image = [element objectForKey:WebElementImageKey];
     BOOL startedDrag = YES;  // optimism - we almost always manage to start the drag
 
     // note per kwebster, the offset arg below is always ignored in positioning the image
-    if (imageURL && (_private->dragSourceActionMask & WebDragSourceActionImage)) {
+    if (imageURL != nil && image != nil && (_private->dragSourceActionMask & WebDragSourceActionImage)) {
         id source = self;
         if (!dhtmlWroteData) {
             _private->draggingImageURL = [imageURL retain];
-            source = [pasteboard _web_declareAndWriteDragImage:[element objectForKey:WebElementImageKey]
+            source = [pasteboard _web_declareAndWriteDragImage:image
                                                            URL:linkURL ? linkURL : imageURL
                                                          title:[element objectForKey:WebElementImageAltStringKey]
                                                        archive:[[element objectForKey:WebElementDOMNodeKey] webArchive]
@@ -922,7 +923,8 @@ static WebHTMLView *lastHitView = nil;
     NSPoint mouseDownPoint = [self convertPoint:location fromView:nil];
     NSDictionary *mouseDownElement = [self elementAtPoint:mouseDownPoint];
 
-    if ([mouseDownElement objectForKey: WebElementImageURLKey] != nil && 
+    if ([mouseDownElement objectForKey: WebElementImageKey] != nil &&
+        [mouseDownElement objectForKey: WebElementImageURLKey] != nil && 
         [[WebPreferences standardPreferences] loadsImagesAutomatically] && 
         (_private->dragSourceActionMask & WebDragSourceActionImage)) {
         return YES;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list