Bug 54099 - Request KHTML support for W3C-style <OBJECT> for applets
Summary: Request KHTML support for W3C-style <OBJECT> for applets
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: kjava (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
: 74746 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-02-04 22:26 UTC by Mike Cowperthwaite
Modified: 2005-04-07 12:57 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch for application/java (1.72 KB, patch)
2004-10-28 05:15 UTC, Yan Morin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Cowperthwaite 2003-02-04 22:26:35 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

W3C's HTML4 describes a particular format of <OBJECT> as an example to invoke a Java applet. This format is supported by Mozilla, Opera, even IE6 and Netscape 4, among others.  KHTML does not support it, so Konqueror and Safari display nothing where the applet should be.

Format of this tag is:
<OBJECT classid="java:appletname" codetype="application/java"
	codebase="..." width="..."  height="...">
    <param name="..." value="..." /> [...]
    [alternate rendering]
</OBJECT>

'codetype' is not necessary, as the "java:" indicates all that one should need to know.  Some browsers require it anyway.  Some allow "application/x-java-applet" or versioned forms thereof as the type.  No browser that supports this tag bothers to check the version information against an installed plugin.  Support for 'archive' attribute is necessary, as well as 'codebase'.  'appletname' should not require the ".class" suffix.  Use of the 'data' attribute is not applicable to this form of the <OBJECT> tag.

Sample URL:
  http://www.well.com/~mcow/OBJ_.html
Comment 1 George Staikos 2003-02-04 22:32:26 UTC
Subject: Re:  New: (rfe) Request KHTML support for W3C-style <OBJECT> for applets

  Koos is already ontop of this!  He has some patches already made, so you can 
expect support for this too.  Maybe even in 3.1.1, but certainly 3.2.0.

On Tuesday 04 February 2003 16:26, Mike Cowperthwaite wrote:
> W3C's HTML4 describes a particular format of <OBJECT> as an example to
> invoke a Java applet. This format is supported by Mozilla, Opera, even IE6
> and Netscape 4, among others.  KHTML does not support it, so Konqueror and
> Safari display nothing where the applet should be.
>
> Format of this tag is:
> <OBJECT classid="java:appletname" codetype="application/java"
> 	codebase="..." width="..."  height="...">
>     <param name="..." value="..." /> [...]
>     [alternate rendering]
> </OBJECT>
>
> 'codetype' is not necessary, as the "java:" indicates all that one should
> need to know.  Some browsers require it anyway.  Some allow
> "application/x-java-applet" or versioned forms thereof as the type.  No
> browser that supports this tag bothers to check the version information
> against an installed plugin.  Support for 'archive' attribute is necessary,
> as well as 'codebase'.  'appletname' should not require the ".class"
> suffix.  Use of the 'data' attribute is not applicable to this form of the
> <OBJECT> tag.
>
> Sample URL:
>   http://www.well.com/~mcow/OBJ_.html
> _______________________________________________
> Konq-bugs mailing list
> Konq-bugs@mail.kde.org
> http://mail.kde.org/mailman/listinfo/konq-bugs

Comment 2 Kai Lahmann 2003-06-15 02:12:05 UTC
bug, not whichlist, as this is part of an W3C standard 
Comment 3 Daniel Naber 2004-02-18 23:29:27 UTC
Looks like its not implemented yet (at least the test page doesn't show the applet).
Comment 4 Mike Cowperthwaite 2004-02-19 00:42:28 UTC
I just checked my test page and it was slightly out of date; it wasn't rendering under Opera or Gecko either.  I've updated it to the 'correct' form.  Please double-check that it's still not working under KHTML. (I'm running only Windows here, I have no means to test it myself).
Comment 5 Daniel Naber 2004-02-20 23:37:09 UTC
*** Bug 74746 has been marked as a duplicate of this bug. ***
Comment 6 Yan Morin 2004-10-25 04:31:35 UTC
kdelibs/khtml/html/html_objectimpl.cpp:151

Around these line:
        else
            m_render = new (getDocument()->renderArena())RenderPartObject(this);

Maybe add a little condition before the "new", something like:

if ( url.isEmpty() && !classId.isEmpty() && classId.startsWith("java:") ) {
 url = classId.substr(5,to_the_end);
}

Question: 
Does URL should be concatened with the codebase attribute? ie.  getAttribute( ATTR_CODEBASE )
Comment 7 Yan Morin 2004-10-25 06:01:15 UTC
Hum, sorry it's already in kdelibs/khtml/rendering/render_frames.cpp:670

I think the problem in the first test case is the codetype="application/java"
work find with codetype="application/x-java-applet"

Some tests case (text/html for all)
http://yansanmo.no-ip.org:8080/test/html/object_java.php
http://yansanmo.no-ip.org:8080/test/html/java/object_java.php
http://yansanmo.no-ip.org:8080/test/html/java/object_java_absolute.php

On my computer, firefox fails all tag with url inside data="".

Another bug maybe, when you look at application/x-java-applet test, the <ul> disapear.

W3C HTML4.01 Specs: http://www.w3.org/TR/html401/struct/objects.html#h-13.3.3
Comment 8 Yan Morin 2004-10-28 05:15:05 UTC
Created attachment 8064 [details]
Patch for application/java

I don't know if application/java comparaison should be case-sensitive or not.
Comment 9 Koos Vriezen 2004-10-28 20:04:48 UTC
CVS commit by vriezen: 

Alias for x-java

CCBUG: 54099


  A            java.desktop   1.1



Comment 10 Koos Vriezen 2004-10-28 20:06:59 UTC
CVS commit by vriezen: 

Support more application/x-java and indirectly application/java mimetype

CCBUG: 54099


  M +1 -1      kjavaappletviewer.desktop   1.61


--- kdelibs/khtml/java/kjavaappletviewer.desktop  #1.60:1.61
@@ -60,5 +60,5 @@
 X-KDE-Library=kjavaappletviewer
 Icon=java
-MimeType=application/x-java-applet;
+MimeType=application/x-java-applet;application/x-java;
 ServiceTypes=KParts/ReadOnlyPart,Browser/View
 Type=Service


Comment 11 Yan Morin 2004-10-30 08:01:51 UTC
There was also this patch (inside my first patch)
When "java:" is found, application/x-java-applet is automatically use even if the service type isn't given with codetype="". The patch is needed to conform with first example in W3C Specs (HTML401). If we do not put 
serviceType = objectbase->serviceType before the if, then this line:
serviceType = "application/x-java-applet"; 
is dead code.


Index: kdelibs/khtml/rendering/render_frames.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/rendering/render_frames.cpp,v
retrieving revision 1.190
diff -u -3 -p -r1.190 render_frames.cpp
--- kdelibs/khtml/rendering/render_frames.cpp   23 Oct 2004 19:34:06 -0000      1.190
+++ kdelibs/khtml/rendering/render_frames.cpp   30 Oct 2004 05:51:32 -0000
@@ -667,6 +667,7 @@ void RenderPartObject::updateWidget()
           if (!objbase->getAttribute(ATTR_HEIGHT).isEmpty())
               params.append( QString::fromLatin1("HEIGHT=\"%1\"").arg( objbase->getAttribute(ATTR_HEIGHT).string() ) );

+          serviceType = objbase->serviceType;
           if (url.isEmpty() && objbase->classId.startsWith("java:")) {
               if ( serviceType.isEmpty() ) serviceType = "application/x-java-applet";
               url = objbase->classId.mid(5);
@@ -675,8 +676,7 @@ void RenderPartObject::updateWidget()
               // render embed object
               url = embed->url;
               serviceType = embed->serviceType;
-          } else
-              serviceType = objbase->serviceType;
+          }
           if(serviceType.isEmpty() && !objbase->classId.isEmpty()) {

               // We have a clsid, means this is activex (Niko)

Comment 12 Koos Vriezen 2004-10-30 12:23:33 UTC
CVS commit by vriezen: 

The classid check for "java:" was undone.

CCBUG: 54099

Thanks for noticing, changed it so serviceType is assigned only once (the
EMBED only case)


  M +4 -5      render_frames.cpp   1.191


--- kdelibs/khtml/rendering/render_frames.cpp  #1.190:1.191
@@ -668,12 +668,11 @@ void RenderPartObject::updateWidget()
               params.append( QString::fromLatin1("HEIGHT=\"%1\"").arg( objbase->getAttribute(ATTR_HEIGHT).string() ) );
 
-          if (url.isEmpty() && objbase->classId.startsWith("java:")) {
-              serviceType = "application/x-java-applet";
-              url = objbase->classId.mid(5);
-          }
           if ( embed ) {
               // render embed object
               url = embed->url;
               serviceType = embed->serviceType;
+          } else if (url.isEmpty() && objbase->classId.startsWith("java:")) {
+              serviceType = "application/x-java-applet";
+              url = objbase->classId.mid(5);
           } else
               serviceType = objbase->serviceType;


Comment 13 Stephan Kulow 2004-11-10 20:59:13 UTC
not fixed?
Comment 14 Koos Vriezen 2005-04-05 15:19:00 UTC
yes, it should be fixed by now.
Comment 15 Koos Vriezen 2005-04-07 12:57:46 UTC
*** Bug has been marked as fixed ***.