summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Gayed <ggayed>2011-06-24 16:29:53 +0000
committerGrant Gayed <ggayed>2011-06-24 16:29:53 +0000
commit0cf2458bdedc1c8ab7562ec0d2fe9423d25c9e06 (patch)
treeeea32894c2aab82be53a4a822e5aa3b5a75663a9
parent7b1d745a08a3e5e966924f3130abf5f742ba4fab (diff)
downloadeclipse.platform.swt-0cf2458bdedc1c8ab7562ec0d2fe9423d25c9e06.tar.gz
eclipse.platform.swt-0cf2458bdedc1c8ab7562ec0d2fe9423d25c9e06.tar.xz
eclipse.platform.swt-0cf2458bdedc1c8ab7562ec0d2fe9423d25c9e06.zip
349837 - Incompatibility between WebKit and XULRunner's sqliteRoot_R3_7_maintenance
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/Browser.java23
1 files changed, 22 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/Browser.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/Browser.java
index 7914e1c482..8bd18e8077 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/Browser.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/Browser.java
@@ -47,9 +47,11 @@ public class Browser extends Composite {
int userStyle;
boolean isClosing;
+ static int DefaultType = SWT.DEFAULT;
+
static final String NO_INPUT_METHOD = "org.eclipse.swt.internal.gtk.noInputMethod"; //$NON-NLS-1$
static final String PACKAGE_PREFIX = "org.eclipse.swt.browser."; //$NON-NLS-1$
- static final String PROPERTY_USEWEBKITGTK = "org.eclipse.swt.browser.UseWebKitGTK"; //$NON-NLS-1$
+ static final String PROPERTY_DEFAULTTYPE = "org.eclipse.swt.browser.DefaultType"; //$NON-NLS-1$
/**
* Constructs a new instance of this class given its parent
@@ -90,6 +92,7 @@ public Browser (Composite parent, int style) {
parent.getDisplay ().setData (NO_INPUT_METHOD, null);
}
+ style = getStyle ();
webBrowser = new BrowserFactory ().createWebBrowser (style);
if (webBrowser != null) {
webBrowser.setBrowser (this);
@@ -122,6 +125,24 @@ static Composite checkParent (Composite parent) {
}
static int checkStyle(int style) {
+ if (DefaultType == SWT.DEFAULT) {
+ String value = System.getProperty (PROPERTY_DEFAULTTYPE);
+ if (value != null) {
+ if (value.equalsIgnoreCase ("mozilla")) { //$NON-NLS-1$
+ DefaultType = SWT.MOZILLA;
+ } else if (value.equalsIgnoreCase ("webkit")) { //$NON-NLS-1$
+ DefaultType = SWT.WEBKIT;
+ }
+ }
+ if (DefaultType == SWT.DEFAULT) {
+ DefaultType = SWT.NONE;
+ }
+ }
+
+ if ((style & (SWT.MOZILLA | SWT.WEBKIT)) == 0) {
+ style |= DefaultType;
+ }
+
if ((style & (SWT.MOZILLA | SWT.WEBKIT)) == (SWT.MOZILLA | SWT.WEBKIT)) {
style &= ~SWT.WEBKIT;
}