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

List:       kde-core-devel
Subject:    patch to allow MIME types like abc/x-abc;version=4
From:       Stefan Schimanski <sts () caldera ! de>
Date:       2000-08-31 10:54:34
[Download RAW message or body]

Hi,

this patch will enable khtml to load the correct kpart if optionial 
information is appended to the type attribute in <embed> or <object>.

Bye
 Schimmi


["html.patch" (text/x-c++)]

Index: html_objectimpl.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/html/html_objectimpl.cpp,v
retrieving revision 1.42
diff -u -b -r1.42 html_objectimpl.cpp
--- html_objectimpl.cpp	2000/08/07 23:33:29	1.42
+++ html_objectimpl.cpp	2000/08/31 10:51:22
@@ -202,11 +202,14 @@
   // export parameter
   QString attrStr = attr->name().string() + "=\"" + val + "\"";
   param.append( attrStr );
-
+  int pos;
   switch ( attr->attrId )
   {
      case ATTR_TYPE:
-	serviceType = val.lower(); // FIXME: is this correct? are MIME types case \
insensitive???? look also into pluginscan.cpp +        serviceType = val.lower();
+        pos = serviceType.find( ";" );
+        if ( pos!=-1 )
+            serviceType = serviceType.left( pos );
 	break;
      case ATTR_SRC:
 	url = val;
@@ -275,9 +278,7 @@
       m_render->setStyle(m_style);
       r->addChild( m_render, _next ? _next->renderer() : 0 );
    } else
-   {
       r->setStyle(m_style);
-   }
 
   NodeBaseImpl::attach( w );
 }
@@ -316,10 +317,14 @@
 {
   DOM::DOMStringImpl *stringImpl = attr->val();
   QString val = QConstString( stringImpl->s, stringImpl->l ).string();
+  int pos;
   switch ( attr->attrId )
   {
     case ATTR_TYPE:
-      serviceType = val;
+      serviceType = val.lower();
+      pos = serviceType.find( ";" );
+      if ( pos!=-1 )
+          serviceType = serviceType.left( pos );
       break;
     case ATTR_DATA:
       url = val;



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

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