[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:36:56 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 795db4a35117ad644cd23718490b390dcaa0391a
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Apr 14 18:01:37 2003 +0000

    	Fixed: 3162338 - Embedding SVG with <object type="image/svg+xml"> doesn't work
    
    	Whenever we encounter an OBJECT tag with a type that starts with "image/" we create a render image object instead of a render part object. The behavior is nice because this allows the render object to resize to the size of the image if no WIDTH and HEIGHT are supplied. For example, the image at the bottom of this page:
    
    	http://tantek.com/CSS/Examples/boxmodelhack.html
    
    	The problem is that we do this for image types that we can't handle and when there are plug-ins that *can* handle the types.
    
            Reviewed by dave.
    
            * khtml/html/html_objectimpl.cpp:
            (HTMLObjectElementImpl::rendererIsNeeded): call canRenderImageType instead of serviceType.startsWith
            (HTMLObjectElementImpl::createRenderer): call canRenderImageType instead of serviceType.startsWith
            (HTMLObjectElementImpl::attach): call canRenderImageType instead of serviceType.startsWith
            * kwq/KWQPixmap.h:
            * kwq/KWQPixmap.mm:
            (canRenderImageType): new, checks if the MIME type is supported by the image factory
            * kwq/WebCoreImageRendererFactory.h: added supportedMIMETypes to the WebCoreImageRendererFactory protocol
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4098 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index ff50efe..9b3c247 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,24 @@
+2003-04-12  Chris Blumenberg  <cblu at apple.com>
+
+	Fixed: 3162338 - Embedding SVG with <object type="image/svg+xml"> doesn't work
+
+	Whenever we encounter an OBJECT tag with a type that starts with "image/" we create a render image object instead of a render part object. The behavior is nice because this allows the render object to resize to the size of the image if no WIDTH and HEIGHT are supplied. For example, the image at the bottom of this page:
+
+	http://tantek.com/CSS/Examples/boxmodelhack.html
+
+	The problem is that we do this for image types that we can't handle and when there are plug-ins that *can* handle the types.
+
+        Reviewed by dave.
+
+        * khtml/html/html_objectimpl.cpp:
+        (HTMLObjectElementImpl::rendererIsNeeded): call canRenderImageType instead of serviceType.startsWith
+        (HTMLObjectElementImpl::createRenderer): call canRenderImageType instead of serviceType.startsWith
+        (HTMLObjectElementImpl::attach): call canRenderImageType instead of serviceType.startsWith
+        * kwq/KWQPixmap.h:
+        * kwq/KWQPixmap.mm:
+        (canRenderImageType): new, checks if the MIME type is supported by the image factory
+        * kwq/WebCoreImageRendererFactory.h: added supportedMIMETypes to the WebCoreImageRendererFactory protocol
+
 2003-04-13  Maciej Stachowiak  <mjs at apple.com>
 
         Reviewed by Trey.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index ff50efe..9b3c247 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,24 @@
+2003-04-12  Chris Blumenberg  <cblu at apple.com>
+
+	Fixed: 3162338 - Embedding SVG with <object type="image/svg+xml"> doesn't work
+
+	Whenever we encounter an OBJECT tag with a type that starts with "image/" we create a render image object instead of a render part object. The behavior is nice because this allows the render object to resize to the size of the image if no WIDTH and HEIGHT are supplied. For example, the image at the bottom of this page:
+
+	http://tantek.com/CSS/Examples/boxmodelhack.html
+
+	The problem is that we do this for image types that we can't handle and when there are plug-ins that *can* handle the types.
+
+        Reviewed by dave.
+
+        * khtml/html/html_objectimpl.cpp:
+        (HTMLObjectElementImpl::rendererIsNeeded): call canRenderImageType instead of serviceType.startsWith
+        (HTMLObjectElementImpl::createRenderer): call canRenderImageType instead of serviceType.startsWith
+        (HTMLObjectElementImpl::attach): call canRenderImageType instead of serviceType.startsWith
+        * kwq/KWQPixmap.h:
+        * kwq/KWQPixmap.mm:
+        (canRenderImageType): new, checks if the MIME type is supported by the image factory
+        * kwq/WebCoreImageRendererFactory.h: added supportedMIMETypes to the WebCoreImageRendererFactory protocol
+
 2003-04-13  Maciej Stachowiak  <mjs at apple.com>
 
         Reviewed by Trey.
diff --git a/WebCore/khtml/html/html_objectimpl.cpp b/WebCore/khtml/html/html_objectimpl.cpp
index c3eb57c..9270f21 100644
--- a/WebCore/khtml/html/html_objectimpl.cpp
+++ b/WebCore/khtml/html/html_objectimpl.cpp
@@ -331,7 +331,7 @@ DocumentImpl* HTMLObjectElementImpl::contentDocument() const
 
 bool HTMLObjectElementImpl::rendererIsNeeded(RenderStyle *style)
 {
-    if (serviceType.startsWith("image/")) {
+    if (canRenderImageType(serviceType)) {
         return HTMLElementImpl::rendererIsNeeded(style);
     }
 
@@ -354,7 +354,7 @@ bool HTMLObjectElementImpl::rendererIsNeeded(RenderStyle *style)
 
 RenderObject *HTMLObjectElementImpl::createRenderer(RenderArena *arena, RenderStyle *style)
 {
-    if (serviceType.startsWith("image/")) {
+    if (canRenderImageType(serviceType)) {
         return new (arena) RenderImage(this);
     }
     return new (arena) RenderPartObject(this);
@@ -364,7 +364,7 @@ void HTMLObjectElementImpl::attach()
 {
     createRendererIfNeeded();
     if (m_render) {
-        if (serviceType.startsWith("image/")) {
+        if (canRenderImageType(serviceType)) {
             m_render->updateFromElement();
         } else {
             // If we are already cleared, then it means that we were attach()-ed previously
diff --git a/WebCore/kwq/KWQPixmap.h b/WebCore/kwq/KWQPixmap.h
index 84cfbed..0781d53 100644
--- a/WebCore/kwq/KWQPixmap.h
+++ b/WebCore/kwq/KWQPixmap.h
@@ -45,6 +45,8 @@ typedef WebCoreImageRenderer *WebCoreImageRendererPtr;
 
 class QWMatrix;
 
+bool canRenderImageType(const QString &type);
+
 class QPixmap : public QPaintDevice, public Qt {
 public:
     QPixmap();
@@ -53,7 +55,7 @@ public:
     QPixmap(int, int);
     QPixmap(const QPixmap &);
     ~QPixmap();
-
+    
     bool isNull() const;
 
     QSize size() const;
diff --git a/WebCore/kwq/KWQPixmap.mm b/WebCore/kwq/KWQPixmap.mm
index b69c918..b163fee 100644
--- a/WebCore/kwq/KWQPixmap.mm
+++ b/WebCore/kwq/KWQPixmap.mm
@@ -28,6 +28,11 @@
 #import "WebCoreImageRenderer.h"
 #import "WebCoreImageRendererFactory.h"
 
+bool canRenderImageType(const QString &type)
+{
+    return [[[WebCoreImageRendererFactory sharedFactory] supportedMIMETypes] containsObject:type.getNSString()];
+}
+
 QPixmap::QPixmap()
 {
     imageRenderer = nil;
diff --git a/WebCore/kwq/WebCoreImageRendererFactory.h b/WebCore/kwq/WebCoreImageRendererFactory.h
index 1267f27..375e3ed 100644
--- a/WebCore/kwq/WebCoreImageRendererFactory.h
+++ b/WebCore/kwq/WebCoreImageRendererFactory.h
@@ -32,6 +32,7 @@
 - (id <WebCoreImageRenderer>)imageRenderer;
 - (id <WebCoreImageRenderer>)imageRendererWithBytes:(const void *)bytes length:(unsigned)length;
 - (id <WebCoreImageRenderer>)imageRendererWithSize:(NSSize)size;
+- (NSArray *)supportedMIMETypes;
 
 @end
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list