Hi Grant.
Thanks for creating these bug
reports.
On Mac SWT Cocoa WebKit using Java Plugin1
(JavaPluginCocoa "Within the browser process"), I am seeing the same issue
in your bug report:
Creation of JVM failed Assertion failed: (env != NULL), function
LocalFramePusher, file
/SourceCache/JavaJDK16Dev/JavaJDK16-322/deploy/src/plugin/share/plugin2/common/LocalFramePusher.h,
line 25.
Using the New Java Plugin2, I was able to get
applets to work, but I experienced a known performance issue with
applets that use the new plugin on Mac:
Applet performance is sluggish, which
is not a SWT issue. Quick explanation: To get applets and other heavy
weight components to blend better and integrate/overlap light-weight
component in the surrounding web-page, Apple changed the way that plugins
are drawn. Java Plugin2 on Mac now forces all rendering to an offscreen
buffer and then draws it through the CoreGraphics api, which is a great
idea actually, but affects the performance of the applet. It causes an
unacceptable delay when scrolling in an applet and a slight
delay when typing in an applet. From what I am reading it also breaks the
frame rate on OpenGL Applets (JOGL & LWJGL) - http://lwjgl.org/forum/index.php?topic=3341.0. Also, mouse over events are not delivered to the applet....
clicks are.
Either way, it looks like applets are a no go on
Mac SWT WebKit browser right now (unless it is a really small applet that
doesn't need to be perfomant and uses plugin2).
I did test applets using Plugin1
(JavaPluginCocoa) on Mac Safari and they works great... no delay or
performance issue there. So, if there was any way around the "LocalFramePusher"
issue above, applets should work fine in the Mac SWT WebKit browser
using Plugin1 (JavaPluginCocoa).
I will add these finding to the bug
report.
I have not tested applets on Windows SWT WebKit,
but I would be more optimistic there as applets do work in the Windows SWT
Mozilla style browser using Plugin2 and applets work in Windows
Safari (WebKit) using Plugin2.
Dermot
----- Original Message -----
Sent: Thursday, February 17, 2011 10:17
AM
Subject: Re: [platform-swt-dev] SWT
browser
Hi Dermot, sorry for the late
reply,
I've confirmed that
enabling applets in the Cocoa-based Browser with the Java Plug-in set to
launch applets in a separate process still crashes. I've logged
https://bugs.eclipse.org/bugs/show_bug.cgi?id=337456 for investigating this, since with the new Java
Plug-in there is at least the hope that this may be possible.
Interestingly, though not really helpful, I notice that the Java plug-in
now detects the case of being loaded in the same process as a running JRE and
no longer crashes, it just aborts its load.
I've logged https://bugs.eclipse.org/bugs/show_bug.cgi?id=337455 for the case of displaying applets in WebKit-based
Browsers on Windows. As the FAQ mentions, applets do work with IE- and
XULRunner-based Browsers on Windows, but it's also worth noting that there are
minimal required versions for these renderers (ie.- launching applets in a
separate process is not sufficient, some support is needed from the native
renderer as well).
Yes, http://www.eclipse.org/swt/faq.php#howbuildjar describes what you need to build the swt jar.
Also possibly useful, http://www.eclipse.org/swt/faq.php#howbuildplugin describes how to use an export wizard to create the
swt eclipse plug-in. If your experiments create any feedback for
enabling applets in these contexts then please add your comments to the bug
reports linked above, thanks!
Grant
"Dermot Doherty"
<dermot@xxxxxxxxxxx> Sent by: platform-swt-dev-bounces@xxxxxxxxxxx
11/02/2011 02:47 PM
Please respond
to "Eclipse Platform SWT component developers list."
<platform-swt-dev@xxxxxxxxxxx> |
|
To
| "Eclipse Platform SWT component
developers list." <platform-swt-dev@xxxxxxxxxxx>
|
cc
|
|
Subject
| Re: [platform-swt-dev] SWT
browser |
|
Thanks Grant. Okay, I will produce some snippets that can evidence these
issues, and file any relevant bugs.
#4 & #5 - SWT WebKit Browser running Java
applets - Okay, I see that FAQ about running Java applets on Mac and the JVMs
colliding. From what Scott said yesterday, could this FAQ point be in place
from Mac Carbon which could also mean that this was an issue with the older
Mac Java plugin. From my experience, the New Java Plugin2 is much more stable
and you can specify to run applets in their own process in Java Preferences.
The rule about applets is that if the codebase is the same, applets will get
loaded in the same JVM. There is also a new parameter "separate_jvm" which
allows a programmer to request a separate JVM. With these tools at hand, it
may be possible for the developer to avert the issue described in this FAQ on
Mac... if it is even still happening on the new Mac Cocoa WebKit using the New
Java Plugin2. I also see that Java is being
disabled on Windows SWT WebKit. This may be unnecesary on Windows who seems to
have no problem with JVMs launching other JVMs. Anyways, I would like to be able to test this and provide some
feedback. I understand that I would have to build the SWT jar, removing the
line of code that disables Java. Is the FAQ http://www.eclipse.org/swt/faq.php#howbuildjar where I go to start this process? Dermot ----- Original Message -----
From: Grant
Gayed To: Eclipse
Platform SWT component developers list.
Sent: Friday, February 11, 2011 9:35 AM
Subject: Re: [platform-swt-dev] SWT browser
Hi Dermot,
#1 - I don't see this, but our
cases may be different. Behaviours like this should be consistent across
the Browser implementations, so please log a report for this and provide a
means of reproducing the error. You can probably just use http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet128.java?view=co and specify a specific url to navigate to
initially.
#2
- Like Scott said, this is very strange. If you are able to make a
reproducible case of it then please log a bug. Without a case that can
be reproduced here it will be impossible to fix this, as I've never heard of
it before.
#3
- Keyboard focus generally works well in Browsers, but it's possible that the
use of AWT in your context is causing some confusion. Again, please log
a report with a snippet that shows the problem.
#4 and #5 - See http://www.eclipse.org/swt/faq.php#browserapplets to start. The WebKit-based Browser on OS X
disables applets because the Java plug-in's attempt to launch a JVM to run the
applet collides with the JVM that's already running SWT/Eclipse, and crashes.
You'll notice in the FAQ that there are some specific contexts where a
Browser will display applets, but what differentiates these contexts is that
they always launch the JVM for running the applet out-of-process, which avoids
the JVM collision that occurs otherwise.
Regarding Browser.getWebBrowser() returning
something from WebKit, this is not something we would do because we don't
expose objects without well-defined API. WebBrowser subclasses utilized
by Browser are internal implementation, and do not expose public methods that
are not already accessible indirectly via Browser API.
Grant
"Dermot Doherty"
<dermot@xxxxxxxxxxx> Sent by:
platform-swt-dev-bounces@xxxxxxxxxxx
10/02/2011 09:21 PM
Please respond
to "Eclipse Platform SWT component developers list."
<platform-swt-dev@xxxxxxxxxxx> |
|
To
| "Eclipse Platform SWT
component developers list."
<platform-swt-dev@xxxxxxxxxxx>
|
cc
|
|
Subject
| Re: [platform-swt-dev] SWT
browser |
|
Thanks Scott. Yes, lots of good
info here.
#4 - SWT WebKit disabling Java - It would be good to look
into removing that for the Mac Cocoa WebKit implementation and also the
Windows WebKit implementation. I tested a simple applet on Windows WebKit
and Mac WebKit and yes, without the Java being enabled, applets do not
work. I suspect that applets should work, given that applets work in Mac
Safari which uses the same Cocoa based WebKit. Applets also work in
Windows Safari, so technically applets should work in the Windows SWT
WebKit browser also.
I am not sure if this is possible, but would it be
possible to return a handle on the WebKit object when calling
Browser.getWebBrowser() from a WebKit style Browser widget, just as
calling Browser.getWebBrowser() returns a handle on the JavaXPCOM
nsIWebBrowser object when using Mozilla.
Browser.getWebBrowser()
returns Object, so that object could be the nsiWebBrowser object or the
WebKit object depending on the browser style.
Something like this for
Mozilla:
nsIWebBrowser webBrowser =
(nsIWebBrowser)browser.getWebBrowser();
and this for
WebKit:
WebKit webBrowser =
(WebKit)browser.getWebBrowser();
It would be nice to get a handle on
that WebKit object to take advantage of more in-depth browser features
(like enabling/disabling Java as per a users
preference).
Dermot
----- Original Message ----- From:
"Scott Kovatch" <skovatch.swt@xxxxxxxxx> To: "Eclipse Platform SWT
component developers list." <platform-swt-dev@xxxxxxxxxxx> Sent:
Thursday, February 10, 2011 6:13 PM Subject: Re: [platform-swt-dev] SWT
browser
>I can answer a few of these, but Grant will likely need
to answer some of >them. > > On Feb 10, 2011, at 3:05 PM,
Dermot Doherty wrote: > >> 2) Both Mozilla and WebKit on Mac
throw a "java.lang.NoSuchMethodError: >> doubleValue". It is
difficult to pinpoint exactly where this is >> occurring, but it
seems to happen when I create a new SWT browser >>
instance. >> This is not happening on Windows. >> See the
log output below: >> java.lang.NoSuchMethodError:
doubleValue >> at
org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method) >>
at org.eclipse.swt.widgets.Display.applicationSendEvent(Unknown
Source) >> at org.eclipse.swt.widgets.Display.applicationProc(Unknown
Source) > > Given that it's java.lang.NoSuchMethodError that makes
me think we're > using reflection somewhere but the object we invoke it
on doesn't have > that method. But, I don't see any uses that call
doubleValue. It's > especially odd to see it during objc_msgSendSuper.
Check Console.app to > see if you're getting any additional
information. > > If you have a simple test case that can reproduce
it, please file a bug. > >> 4) SWT WebKit browser on Mac
disables Java when embedded in Safari. >> Explanation: When a SWT
WebKit Browser is embedded in a Java applet on >> Mac the "Enable
Java" preference gets disabled. This is not happening >> when the
Mozilla engine is used. >> Is there something in the WebKit
implementation that automatically >> disables Java that may be
getting picked up by Safari which is also using >> the same WebKit
engine. This only happens for the first SWT WebKit >> browser that
is embedded. Subsequently embedded SWT WebKit browsers on >> the
same page do not disable the Java (after manually enabling the Java
>> in Preferences > Security). > > See
WebKit.java: > >
WebPreferences.standardPreferences().setJavaEnabled(false); > >
But, it's only called once during initialization. I suspect >
standardPreferences() are per-user, so it makes sense that turning it on
> again in Java Preferences would enable it again for any additional
Browser > widgets created. > > This is probably a holdover
from Carbon. I seem to recall a situation > where you could end up
embedding Cocoa (WebKit) into Carbon and then > somehow putting a
Carbon view into the Browser. And you can't mix Carbon > and Cocoa that
way, so it makes sense to block applets. In Cocoa there may > not be a
reason to prevent that. > >> 5) Do Java Applets run in the SWT
WebKit browser? > > I don't know that we've ever tried. On the Mac
it may work now in Cocoa, > but you'd have to rebuild the SWT to try it
out. > > Hope some of that helps. > > -- Scott
K. > > ------------------ > Scott Kovatch >
IBM > Eclipse Platform Team > Pleasanton,
CA > > > >
_______________________________________________ > platform-swt-dev
mailing list > platform-swt-dev@xxxxxxxxxxx > https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
_______________________________________________ platform-swt-dev
mailing list platform-swt-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
_______________________________________________ platform-swt-dev
mailing list platform-swt-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/platform-swt-dev_______________________________________________ platform-swt-dev
mailing list platform-swt-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
_______________________________________________ platform-swt-dev
mailing
list platform-swt-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
|