diff options
3 files changed, 21 insertions, 34 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 6168c20201..09889544de 100644 --- 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 @@ -125,6 +125,7 @@ static Composite checkParent (Composite parent) { } static int checkStyle(int style) { + String platform = SWT.getPlatform (); if (DefaultType == SWT.DEFAULT) { /* * Some Browser clients that explicitly specify the native renderer to use @@ -154,11 +155,26 @@ static int checkStyle(int style) { 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; - } + int index = 0; + int length = value.length(); + do { + int newIndex = value.indexOf(',', index); + if (newIndex == -1) { + newIndex = length; + } + String current = value.substring(index, newIndex).trim(); + if (current.equalsIgnoreCase ("mozilla")) { //$NON-NLS-1$ + DefaultType = SWT.MOZILLA; + break; + } else if (current.equalsIgnoreCase ("webkit")) { //$NON-NLS-1$ + DefaultType = SWT.WEBKIT; + break; + } else if (current.equalsIgnoreCase ("ie") && "win32".equals (platform)) { //$NON-NLS-1$ //$NON-NLS-2$ + DefaultType = SWT.NONE; + break; + } + index = newIndex + 1; + } while (index < length); } if (DefaultType == SWT.DEFAULT) { DefaultType = SWT.NONE; @@ -172,7 +188,6 @@ static int checkStyle(int style) { if ((style & (SWT.MOZILLA | SWT.WEBKIT)) == (SWT.MOZILLA | SWT.WEBKIT)) { style &= ~SWT.WEBKIT; } - String platform = SWT.getPlatform (); if ((style & SWT.MOZILLA) != 0 || (style & SWT.WEBKIT) != 0) { if ("carbon".equals (platform)) return style | SWT.EMBEDDED; //$NON-NLS-1$ if ("motif".equals (platform)) return style | SWT.EMBEDDED; //$NON-NLS-1$ diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/gtk/org/eclipse/swt/browser/BrowserFactory.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/gtk/org/eclipse/swt/browser/BrowserFactory.java index 12e627641a..f2b6579826 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Browser/gtk/org/eclipse/swt/browser/BrowserFactory.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Browser/gtk/org/eclipse/swt/browser/BrowserFactory.java @@ -14,27 +14,13 @@ import org.eclipse.swt.SWT; class BrowserFactory { - static boolean mozillaLibsLoaded; - WebBrowser createWebBrowser (int style) { boolean webkitInstalled = WebKit.IsInstalled (); if ((style & SWT.MOZILLA) != 0 || (!webkitInstalled && (style & SWT.WEBKIT) == 0)) { - mozillaLibsLoaded = true; return new Mozilla (); } if (!webkitInstalled) return null; - /* - * A crash can occur if XULRunner-1.9.2.x is loaded into a process where WebKit has - * already been loaded, as a result of conflicting versions of the sqlite3 library. - * Loading these native renderers in the reverse order does not cause a problem. The - * crash workaround is to ensure that Mozilla's libraries (if available) are always - * loaded before WebKit's. - */ - if (!mozillaLibsLoaded) { - mozillaLibsLoaded = true; - Mozilla.LoadLibraries (); - } return new WebKit (); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/BrowserFactory.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/BrowserFactory.java index d55b4996aa..7f67d30eb7 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/BrowserFactory.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/BrowserFactory.java @@ -15,28 +15,14 @@ import org.eclipse.swt.internal.win32.OS; class BrowserFactory { - static boolean mozillaLibsLoaded; - WebBrowser createWebBrowser (int style) { if (OS.IsWinCE && (style & (SWT.MOZILLA | SWT.WEBKIT)) != 0) { throw new SWTError (SWT.ERROR_NO_HANDLES, "Unsupported Browser type"); //$NON-NLS-1$ } if ((style & SWT.MOZILLA) != 0) { - mozillaLibsLoaded = true; return new Mozilla (); } if ((style & SWT.WEBKIT) != 0) { - /* - * A crash can occur if XULRunner-1.9.2.x is loaded into a process where WebKit has - * already been loaded, as a result of conflicting versions of the sqlite3 library. - * Loading these native renderers in the reverse order does not cause a problem. The - * crash workaround is to ensure that Mozilla's libraries (if available) are always - * loaded before WebKit's. - */ - if (!mozillaLibsLoaded) { - mozillaLibsLoaded = true; - Mozilla.LoadLibraries (); - } return new WebKit (); } return new IE (); |