Hi,
I have been testing the SWT Mozilla and WebKit
browser implementations on Mac and Windows. I have come across some issues and questions and wanted to run
them past this list first before filing any bugs.
1) WebKit fires a second LocationEvent for
"about:blank". (Reproducable on Mac WebKit and Windows
WebKit - not sure if this is a feature or a bug.)
Explanation: The WebKit engine fires a second
LocationEvent for "about:blank" after firing the initial LocationEvent for the
URL being requested.
The event object for the "about:blank" has
top=false. The event object for the URL being requested has top=true,
which allows the events to be differentiated but I see no reason for this second
LocationEvent to be fired. This is only happening for the first URL that is
loaded into the browser instance. Subsequent requests for URLs do not fire the
"about:blank" LocationEvent.
This is not happening in Mozilla, so this
is either a feature or bug from WebKit.
See the log output below:
2890567 [AWT-AppKit] DEBUG SB -
LocationListener.changed(LocationEvent{Browser {} time=0 data=""
location=http://www.google.com/ top=true doit=false}) 2890599 [AWT-AppKit]
DEBUG SB - LocationListener.changed(LocationEvent{Browser {} time=0 data=""
location=about:blank top=false doit=false})
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)
3) Mozilla engine on Mac only gives keyboard input
focus to the last SWT browser added to the hierarchy.
Explanation: The first SWT Browser is
created and added using SWT_AWT.new_Shell(display, canvas). Navigating to
Google shows the cursor in the search box and input is
possible. Next, another SWT Browser instance is created in the same
manner and added to the AWT component. Navigating to Google shows
the cursor in the search box and input is possible. The problem
occurs whenever you switch back to the previous SWT browser. The SWT browser
gets focus, allows navigation and delivers StatusTextEvent when mousing over
links, but it does not allow keyboard input in the text box and the text box
does not get the cursor when you click inside it. When you switch back to the
last SWT browser that was added to the hierarchy, input is possible in
that text box. Thus, input is only available in the last SWT
Browser that was added. This continues to happen for as many SWT browsers
that are added. i.e. input in previously added SWT Browsers gets disabled and is
only possible in the last SWT browser that was added.
This is not happening on Mac WebKit and is
not happening on Windows at all.
The first thought would be that this is a coding
error with focus, but focus is deliberately set
on the Browser Control in an attempt to enable it using
Composite.setFocus() and focus is confirmed by calling Browser.isFocusControl()
which returns true. As I say above, it seems that the Browser is active as
links do work and StatusTextEvents get fired when mousing over links. It's just
the input boxes that do not get enabled for keyboard input.
See the log output below where focus is
deliberately set on the SWT Browser and is confirmed, although input is
still unavailable.
74326 [AWT-AppKit] DEBUG SB - browser = Browser {} 74326 [AWT-AppKit]
DEBUG SB - browser.isFocusControl() = false 74326 [AWT-AppKit] DEBUG SB -
boolean setFocus = browser.setFocus() 74327 [AWT-AppKit] DEBUG SB - setFocus
= true 74327 [AWT-AppKit] DEBUG SB - browser.isFocusControl() = true
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).
5) Do Java Applets run in the SWT WebKit
browser?
On Mac, I have been using SWT 3.6.1. On Windows, I
have been using SWT 3.7M5.
That's it. Thanks for any light you can shed on
these issues.
Dermot
|