From 0cf2458bdedc1c8ab7562ec0d2fe9423d25c9e06 Mon Sep 17 00:00:00 2001 From: Grant Gayed Date: Fri, 24 Jun 2011 16:29:53 +0000 Subject: 349837 - Incompatibility between WebKit and XULRunner's sqlite --- .../common/org/eclipse/swt/browser/Browser.java | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'bundles') 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; } -- cgit