[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/khtml
From:       Allan Sandfeld Jensen <kde () carewolf ! com>
Date:       2005-05-11 14:08:15
Message-ID: 1115820495.629744.10480.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 412369 by carewolf:

Render the eyes from Acid2 by extracting and responding to image 
service-type. (Amazingly dissimilar from the corresponding WebCore patch)
BUG:


 M  +5 -0      trunk/KDE/kdelibs/khtml/ChangeLog  
 M  +19 -3     trunk/KDE/kdelibs/khtml/html/html_objectimpl.cpp  


--- trunk/KDE/kdelibs/khtml/ChangeLog #412368:412369
@@ -1,3 +1,8 @@
+2005-05-11  Allan Sandfeld Jensen <kde@carewolf.com>
+
+        * html/html_objectimpl.cpp: Extract service-type from "data:" url and create
+        renderer for all images
+
 2005-05-09  Allan Sandfeld Jensen <kde@carewolf.com>
 
         Speed-up white-space collapsing by only allocating once.
--- trunk/KDE/kdelibs/khtml/html/html_objectimpl.cpp #412368:412369
@@ -126,7 +126,24 @@
     assert(!attached());
     assert(!m_render);
 
-    if (m_renderAlternative) {
+    if (serviceType.isEmpty() && url.startsWith("data:")) {
+        // Extract the MIME type from the data URL.
+        int index = url.find(';');
+        if (index == -1)
+            index = url.find(',');
+        if (index != -1) {
+            int len = index - 5;
+            if (len > 0)
+                serviceType = url.mid(5, len);
+            else
+                serviceType = "text/plain"; // Data URLs with no MIME type are considered text/plain.
+        }
+    }
+
+    bool imagelike = serviceType.startsWith("image/") &&
+                   !KImageIO::typeForMime(serviceType).isNull();
+
+    if (m_renderAlternative && !imagelike) {
         // render alternative content
         ElementImpl::attach();
         return;
@@ -144,8 +161,7 @@
         _style->display() != NONE)
     {
         needWidgetUpdate = false;
-        bool imagelike = serviceType.startsWith("image/") &&
-                         !KImageIO::typeForMime(serviceType).isNull();
+
         if (imagelike) {
             m_render = new (getDocument()->renderArena()) RenderImage(this);
             // make sure we don't attach the inner contents
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic