Calling applet method from JavaScript works with <object></object> or <embed></embed>, but NOT with nested <object><embed></embed><object>




17 years ago
16 years ago


(Reporter: Magnus.Kessler, Assigned: Peter Lubczynski)


Windows 2000

Firefox Tracking Flags

(Not tracked)



(5 attachments)



17 years ago
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.6+)
BuildID:    2001112003

Calling a method on an object works fine when the applet is either started using
the <object> tag or the <embed> tag. However, the same calls fail with a "is not
a function" message in the javascript console if the <embed> tag is nested
inside the object tag.

Reproducible: Always
Steps to Reproduce:
1. copy the attached html files and the class file into one directory
2. point the browser to either liveconnecttest.html, liveconnect_object.html or
3. click on the "Test" button.

Actual Results:  With liveconnecttest.html (nested tags), an alert appears,
showing that the applet has started. Clicking on the "Test" button does not seem
to do anything. In the JavaScript console two error messages "callXXX is not a
function" appear.

Expected Results:  Two additional alerts should appear displaying text generated
by the applet.

The same applet works fine if the page contains either exclusively the <object>
or the <embed> tag as demonstrated by the other html files. Nesting <object> and
<embed> tags is however the recommended way of using the Java plugin with both
Netscape4 and other browsers understanding the <object> tag.

(will submit attachments ASAP)

Comment 1

17 years ago
Created attachment 58995 [details] (applet source code)

Comment 2

17 years ago
Created attachment 58996 [details]
LiveConnectTest.class (applet class file)

Comment 3

17 years ago
Created attachment 58997 [details]
liveconnecttest.html (html file demonstrating the bug)

Comment 4

17 years ago
Created attachment 58998 [details]
liveconnect_embed.html (works fine)

Comment 5

17 years ago
Created attachment 58999 [details]
liveconnect_object.html (works fine)
Assignee: joe.chou → rogerl
Component: OJI → Live Connect
Ever confirmed: true
QA Contact: pmac → pschwartau

Comment 7

17 years ago
Reassigning to OJI component; cc'ing Patrick. 
Assignee: rogerl → joe.chou
Component: Live Connect → OJI
QA Contact: pschwartau → pmac
Summary: LiveConnect: calling applet method from javascript works with <object></object> or <embed></embed>, but NOT with nested <object><embed></embed><object> → Calling applet method from JavaScript works with <object></object> or <embed></embed>, but NOT with nested <object><embed></embed><object>

Comment 8

17 years ago
nominating for mozilla1.0 because <object><embed></embed><object> is used fairly
Component: OJI → Live Connect
Keywords: mozilla1.0


17 years ago
Target Milestone: --- → mozilla1.0

Comment 9

17 years ago
This is unlikely to be an OJI problem, more likely an object frame problem.
Reassigning to peterl.
Assignee: joe.chou → peterl
Component: Live Connect → Plug-ins


17 years ago
Target Milestone: mozilla1.0 → mozilla0.9.8


16 years ago
Target Milestone: mozilla0.9.8 → mozilla1.0


16 years ago
Depends on: 108557

Comment 10

16 years ago
I think there are two things to make the <embed> tag work in attachment #58997 [details]:

1. The patch in bug 108557. This will make us use the nested <embed> tag rather
than the OBJECT. The patch needs super review.

2. The ID/NAME attributes of the OBJECT rand EMBED tags conflict. Using
different names and applying the patch attchment #58294 makes the testcase work
for me.

Comment 11

16 years ago
nominating nsbeta1
Keywords: nsbeta1

Comment 12

16 years ago
marking nsbeta1-; bug 108557 has been plussed.
Keywords: nsbeta1 → nsbeta1-


16 years ago
Target Milestone: mozilla1.0 → mozilla1.1

Comment 13

16 years ago
Ok, I'm having some serious difficulty in fathoming the decision to ignore the 
<object> tag and use the <embed> tag?????  The <embed> tag was a Netscape 4 
proprietary thing.  It isn't even mentioned in the html 4.0.1 spec, for god's 
sake!  Seriously, what the hell?

IE seems to have a dandy time with the <object> tag.  I haven't tried Opera, 
but I'll bet they aren't going to do anything with the <embed> tag.  If this is 
a "parity with Netscape 4" thing, just forget that.  Netscape 4 sucked from the 
beginning, so why would Mozilla want parity with something that sucks anyway?  
To be fair there might have been some things that people liked about Netscape 
4, but the proprietary <embed> tag most certainly was not one of them!

The whole <object><comment><embed><noembed></noembed></embed><comment></object> 
is a kludge so that the Sun Java Plugin can be used with multiple browsers 
including Netscape 4.  If we got rid of the Netscape 4 crap (can you 
say "dwindling market share" 5 times fast?), then we'd just use 
<object></object>.  Now you are saying "let's continue with the Netscape 4 
kludge in Mozilla/Netscape6"?  Where is the logic there?

Man, maybe I am just way late in the game and I missed all the important 
discussions about why we need to do this, but now I can't write a page that 
validates as html401 if I want to run an applet in Mozilla...but in IE, I can 
be standards compliant.  Have I just stepped into Bizarro World????????

Am I way off base here?  I think a *very* good explanation is in order before 
we commit to this because this crap is going to stick with us for a long time 
if Mozilla 1.0 doesn't support the <object> tag and continues to support the 
<embed> tag.


Comment 14

16 years ago
Based on my comment #10 that bug 108557 is fixed, marking this WFM.

btw, this bug is not about making the OBJECT tag work because it already does,
but rather making the nested EMBED tag work.
Last Resolved: 16 years ago
Resolution: --- → WORKSFORME

Comment 15

16 years ago
Well, in that case, then the WFM is totally wrong, unless I'm missing 
something.  When I try to invoke the applet using the object tag alone, in IE 
the applet fires up, in Mozilla (current nightly builds) the JVM doesn't even 
start so, of course, that means the applet won't fire up.  In the case of the 
<embed> tag and the <applet> tag, the JVM fires up and runs the applet just 
fine...except <applet> is deprecated (and has been for a long time) and <embed> 
doesn't even exist in the w3c html401 spec.

In addition, if I try using the following structure:


that Sun's HTMLConverter tool creates to work for both IE and Netscape 4, 
Mozilla loads up the applet (presumably because of its support for <embed>) and 
the Java --> Javascript communication works great...however, the javascript --> 
Java communication doesn't work at all.  I can't call any methods in the applet 
from Javascript because of the failure reported as comment 0.

Unless this has changed in the last day on the trunk, this is *not* WFM and all 
my previous objections stand unless you can explain why the <object> tag alone 
is not loading up my applet.



16 years ago
QA Contact: pmac → petersen
You need to log in before you can comment on or make changes to this bug.