[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 07:08:28 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit bc671db7c2b0db4837b10798100fca8323bd7a82
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Nov 26 01:44:18 2002 +0000

    WebCore:
    
    	Fixed: 2987001 - spurious mime-type errors from <object> images
    
    	KHTML didn't seem to have any clean support for OBJECT tags that are images. Added support for that.
    
            * khtml/css/html4.css: OBJECTs that are images should be rendered inline
            * khtml/html/html_objectimpl.cpp:
            (HTMLObjectElementImpl::attach): if the type is an image, create a render image
            * khtml/rendering/render_image.cpp:
            (RenderImage::updateFromElement): if the element is an object, use DATA for the URL
            * kwq/KWQDOMNode.cpp:
            (isImage): if it is an OBJECT element, check the type
            * kwq/WebCoreBridge.mm:
            (-[WebCoreBridge elementAtPoint:]): if the element is an object, use DATA for the URL
    
    WebKit:
    
    	Fixed 2 drag-related crashes. Oops.
    
            * Misc.subproj/WebNSViewExtras.m:
            (-[NSView _web_dragPromisedImage:fromOrigin:withURL:title:event:]): put nil at the end of the array list.
            * WebView.subproj/WebHTMLView.m:
            (-[WebHTMLView mouseDragged:]): retain self before drag
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2869 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 25a95ff..4073833 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,19 @@
+2002-11-25  Chris Blumenberg  <cblu at apple.com>
+
+	Fixed: 2987001 - spurious mime-type errors from <object> images
+
+	KHTML didn't seem to have any clean support for OBJECT tags that are images. Added support for that.
+
+        * khtml/css/html4.css: OBJECTs that are images should be rendered inline
+        * khtml/html/html_objectimpl.cpp:
+        (HTMLObjectElementImpl::attach): if the type is an image, create a render image
+        * khtml/rendering/render_image.cpp:
+        (RenderImage::updateFromElement): if the element is an object, use DATA for the URL
+        * kwq/KWQDOMNode.cpp:
+        (isImage): if it is an OBJECT element, check the type
+        * kwq/WebCoreBridge.mm:
+        (-[WebCoreBridge elementAtPoint:]): if the element is an object, use DATA for the URL
+
 2002-11-25  David Hyatt  <hyatt at apple.com>
 
 	Fix this even further.  JUst drop support for arbitrary
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 25a95ff..4073833 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,19 @@
+2002-11-25  Chris Blumenberg  <cblu at apple.com>
+
+	Fixed: 2987001 - spurious mime-type errors from <object> images
+
+	KHTML didn't seem to have any clean support for OBJECT tags that are images. Added support for that.
+
+        * khtml/css/html4.css: OBJECTs that are images should be rendered inline
+        * khtml/html/html_objectimpl.cpp:
+        (HTMLObjectElementImpl::attach): if the type is an image, create a render image
+        * khtml/rendering/render_image.cpp:
+        (RenderImage::updateFromElement): if the element is an object, use DATA for the URL
+        * kwq/KWQDOMNode.cpp:
+        (isImage): if it is an OBJECT element, check the type
+        * kwq/WebCoreBridge.mm:
+        (-[WebCoreBridge elementAtPoint:]): if the element is an object, use DATA for the URL
+
 2002-11-25  David Hyatt  <hyatt at apple.com>
 
 	Fix this even further.  JUst drop support for arbitrary
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 25a95ff..4073833 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,19 @@
+2002-11-25  Chris Blumenberg  <cblu at apple.com>
+
+	Fixed: 2987001 - spurious mime-type errors from <object> images
+
+	KHTML didn't seem to have any clean support for OBJECT tags that are images. Added support for that.
+
+        * khtml/css/html4.css: OBJECTs that are images should be rendered inline
+        * khtml/html/html_objectimpl.cpp:
+        (HTMLObjectElementImpl::attach): if the type is an image, create a render image
+        * khtml/rendering/render_image.cpp:
+        (RenderImage::updateFromElement): if the element is an object, use DATA for the URL
+        * kwq/KWQDOMNode.cpp:
+        (isImage): if it is an OBJECT element, check the type
+        * kwq/WebCoreBridge.mm:
+        (-[WebCoreBridge elementAtPoint:]): if the element is an object, use DATA for the URL
+
 2002-11-25  David Hyatt  <hyatt at apple.com>
 
 	Fix this even further.  JUst drop support for arbitrary
diff --git a/WebCore/khtml/css/html4.css b/WebCore/khtml/css/html4.css
index a56187e..cfa46b6 100644
--- a/WebCore/khtml/css/html4.css
+++ b/WebCore/khtml/css/html4.css
@@ -109,6 +109,21 @@ OBJECT {
 	display: block;
 } 
 
+/* Dave: Please add support for ~ so we can match on "image/" instead specific image mime types. */ 
+
+OBJECT[type="image/png"] {
+	display: inline;
+}
+
+OBJECT[type="image/gif"] {
+	display: inline;
+}
+
+OBJECT[type="image/jpeg"] {
+	display: inline;
+}
+
+
 APPLET { 
 	display: block;
 } 
@@ -134,16 +149,6 @@ MAP {
 	display: inline;
 } 
 
-object {
-        width: 50px;
-        height: 50px;
-}   
-
-embed {
-        width: 50px;
-        height: 50px;
-}   
-
 
 /* 
  * heading elements 
diff --git a/WebCore/khtml/html/html_objectimpl.cpp b/WebCore/khtml/html/html_objectimpl.cpp
index 6c244eb..0950737 100644
--- a/WebCore/khtml/html/html_objectimpl.cpp
+++ b/WebCore/khtml/html/html_objectimpl.cpp
@@ -37,6 +37,7 @@
 #include "css/cssvalues.h"
 #include "rendering/render_applet.h"
 #include "rendering/render_frames.h"
+#include "rendering/render_image.h"
 #include "xml/dom2_eventsimpl.h"
 
 #ifndef Q_WS_QWS // We don't have Java in Qt Embedded
@@ -332,9 +333,21 @@ void HTMLObjectElementImpl::attach()
 {
     assert(!attached());
     assert(!m_render);
-
+    
     KHTMLView* w = getDocument()->view();
     bool loadplugin = w->part()->pluginsEnabled();
+    RenderStyle* _style = getDocument()->styleSelector()->styleForElement(this);
+    
+    _style->ref();
+    
+    if(serviceType.startsWith("image/") && parentNode()->renderer() && _style->display() != NONE){
+        m_render = new (getDocument()->renderArena()) RenderImage(this);
+        m_render->setStyle(getDocument()->styleSelector()->styleForElement(this));
+        parentNode()->renderer()->addChild(m_render, nextRenderer());
+        m_render->updateFromElement();
+        loadplugin = false;
+    }
+    
 #if APPLE_CHANGES
     // This check showed up during the KDE 3.0 -> 3.0.1 transition.
     // We can't figure out exactly what it's supposed to do, but it prevents
@@ -356,10 +369,12 @@ void HTMLObjectElementImpl::attach()
     if (loadplugin && parentNode()->renderer()) {
         needWidgetUpdate = false;
         m_render = new (getDocument()->renderArena()) RenderPartObject(this);
-        m_render->setStyle(getDocument()->styleSelector()->styleForElement(this));
+        m_render->setStyle(_style);
         parentNode()->renderer()->addChild(m_render, nextRenderer());
     }
 
+    _style->deref();
+
     NodeBaseImpl::attach();
 
     // Go ahead and perform the update.
diff --git a/WebCore/khtml/rendering/render_image.cpp b/WebCore/khtml/rendering/render_image.cpp
index 461d715..d26657d 100644
--- a/WebCore/khtml/rendering/render_image.cpp
+++ b/WebCore/khtml/rendering/render_image.cpp
@@ -368,19 +368,22 @@ bool RenderImage::nodeAtPoint(NodeInfo& info, int _x, int _y, int _tx, int _ty)
 
 void RenderImage::updateFromElement()
 {
-#if APPLE_CHANGES
-    // Treat a lack of src or empty string for src as no image at all, not the page itself
+    DOMString attr;
+    // Support images in OBJECT tags.
+    if (element()->id() == ID_OBJECT) {
+        attr = element()->getAttribute(ATTR_DATA);
+    } else {
+        attr = element()->getAttribute(ATTR_SRC);
+    }
+    
+    // Treat a lack of src orempty string for src as no image at all, not the page itself
     // loaded as an image.
-    DOMString attr = element()->getAttribute(ATTR_SRC);
     CachedImage *new_image;
-    if (attr.isEmpty())
+    if (attr.isEmpty()) {
         new_image = NULL;
-    else
+    } else {
         new_image = element()->getDocument()->docLoader()->requestImage(khtml::parseURL(attr));
-#else
-    CachedImage *new_image = element()->getDocument()->docLoader()->
-                             requestImage(khtml::parseURL(element()->getAttribute(ATTR_SRC)));
-#endif
+    }
 
     if(new_image && new_image != image && (!style() || !style()->contentObject())) {
         loadEventSent = false;
diff --git a/WebCore/kwq/KWQDOMNode.cpp b/WebCore/kwq/KWQDOMNode.cpp
index f8b9d43..e30a855 100644
--- a/WebCore/kwq/KWQDOMNode.cpp
+++ b/WebCore/kwq/KWQDOMNode.cpp
@@ -39,7 +39,12 @@ bool isImage(DOM::NodeImpl *node)
         if(i->getAttribute(ATTR_TYPE) == "image"){
             return true;
         }
+    }else if(node->id() == ID_OBJECT){
+        ElementImpl* i =  static_cast<ElementImpl*>(node);
+        if(i->getAttribute(ATTR_TYPE).string().startsWith("image/")){
+            return true;
+        }
     }
 
     return false;
-}
+}
\ No newline at end of file
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index d2de55e..d1225a0 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -552,19 +552,26 @@ NSString *WebCoreElementStringKey = 		@"WebElementString";
         }
     }
 
-    NodeImpl *imageNode = nodeInfo.innerNonSharedNode();
-    if (imageNode && isImage(imageNode)) {
-        ElementImpl* i =  static_cast<ElementImpl*>(imageNode);
-        NSString *altString = i->getAttribute(ATTR_ALT).string().getNSString();
-        if(altString){
-            [element setObject:altString forKey:WebCoreElementImageAltStringKey];
+    NodeImpl *node = nodeInfo.innerNonSharedNode();
+    if (node && isImage(node)){
+
+        ElementImpl* i =  static_cast<ElementImpl*>(node);
+        DOMString attr = i->getAttribute(ATTR_SRC);
+        if(attr.isEmpty()){
+            // Look for the URL in the DATA attribute of the OBJECT tag.
+            attr = i->getAttribute(ATTR_DATA);
         }
-        
-        NSString *URLString = _part->kwq->document()->completeURL(i->getAttribute(ATTR_SRC).string()).getNSString();
-        
+
+        NSString *URLString = _part->kwq->document()->completeURL(attr.string()).getNSString();        
         if (URLString) {
             [element setObject:URLString forKey:WebCoreElementImageURLKey];
-            RenderImage *r = (RenderImage *)imageNode->renderer();
+            
+            NSString *altString = i->getAttribute(ATTR_ALT).string().getNSString();
+            if(altString){
+                [element setObject:altString forKey:WebCoreElementImageAltStringKey];
+            }
+            
+            RenderImage *r = (RenderImage *)node->renderer();
             id <WebCoreImageRenderer> image = r->pixmap().image();
             if (image) {
                 [element setObject:image forKey:WebCoreElementImageKey];
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index f64dd4b..1bfa5de 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,14 @@
 2002-11-25  Chris Blumenberg  <cblu at apple.com>
 
+	Fixed 2 drag-related crashes. Oops.
+
+        * Misc.subproj/WebNSViewExtras.m:
+        (-[NSView _web_dragPromisedImage:fromOrigin:withURL:title:event:]): put nil at the end of the array list.
+        * WebView.subproj/WebHTMLView.m:
+        (-[WebHTMLView mouseDragged:]): retain self before drag
+
+2002-11-25  Chris Blumenberg  <cblu at apple.com>
+
 	- Allow missing icons to be restored when going to the page of the missing icon.
 
         * Misc.subproj/WebIconDatabase.m:
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index f64dd4b..1bfa5de 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,5 +1,14 @@
 2002-11-25  Chris Blumenberg  <cblu at apple.com>
 
+	Fixed 2 drag-related crashes. Oops.
+
+        * Misc.subproj/WebNSViewExtras.m:
+        (-[NSView _web_dragPromisedImage:fromOrigin:withURL:title:event:]): put nil at the end of the array list.
+        * WebView.subproj/WebHTMLView.m:
+        (-[WebHTMLView mouseDragged:]): retain self before drag
+
+2002-11-25  Chris Blumenberg  <cblu at apple.com>
+
 	- Allow missing icons to be restored when going to the page of the missing icon.
 
         * Misc.subproj/WebIconDatabase.m:
diff --git a/WebKit/Misc.subproj/WebNSViewExtras.m b/WebKit/Misc.subproj/WebNSViewExtras.m
index 3a99bb7..f4dd745 100644
--- a/WebKit/Misc.subproj/WebNSViewExtras.m
+++ b/WebKit/Misc.subproj/WebNSViewExtras.m
@@ -185,7 +185,7 @@
     NSArray *filesTypes = [NSArray arrayWithObject:[[URL path] pathExtension]];
     
     NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSDragPboard];
-    [pboard declareTypes:[NSArray arrayWithObjects:NSFilesPromisePboardType, NSTIFFPboardType] owner:self];
+    [pboard declareTypes:[NSArray arrayWithObjects:NSFilesPromisePboardType, NSTIFFPboardType, nil] owner:self];
     [pboard setPropertyList:filesTypes forType:NSFilesPromisePboardType];
     [pboard setData:[image TIFFRepresentation] forType:NSTIFFPboardType];
     [pboard _web_writeURL:URL andTitle:title withOwner:self];
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index f4d759d..4eea986 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -724,7 +724,9 @@
                 NSPoint mousePoint = [self convertPoint:[event locationInWindow] fromView:nil];
                 NSSize centerOffset = NSMakeSize(imageSize.width / 2, -DRAG_LABEL_BORDER_Y);
                 NSPoint imagePoint = NSMakePoint(mousePoint.x - centerOffset.width, mousePoint.y - centerOffset.height);
-                
+
+                // Retain this view during the drag because it may be released before the drag ends.
+                [self retain];
                 [self dragImage:dragImage
                              at:imagePoint
                          offset:centerOffset

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list