Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Furnadjiev2016-05-27 11:50:25 -0400
committerMarkus Knauer2016-05-27 13:19:58 -0400
commit91eaa194a5eff77fef97739613e695297e3f0ae0 (patch)
tree558c37a33aad1c7b42cb92c45a5163ca5ff0d3a4 /bundles
parent80f00f246c6af616076a27720ef6221fff7fc09f (diff)
downloadorg.eclipse.rap-91eaa194a5eff77fef97739613e695297e3f0ae0.tar.gz
org.eclipse.rap-91eaa194a5eff77fef97739613e695297e3f0ae0.tar.xz
org.eclipse.rap-91eaa194a5eff77fef97739613e695297e3f0ae0.zip
Fix client crash when Browser is created with V/H_SCROLL style flags
When scrollable widget is created with V/H_SCROLL style flags, a ScrollBar widget is created/rendered by the protocol. As client-side browser widget can't have children (doesn't extend Parent), adding scrollbars to it leads to a crash. Browser widget is based on HTML iframe and doesn't have a separate, managed by the server scrollbars. Clear Browser V/H_SCROLL style bits if set. 494759: Browser with style flag SWT.H_SCROLL or SWT.V_SCROLL fails https://bugs.eclipse.org/bugs/show_bug.cgi?id=494759 Change-Id: I38f397da679eff212864dcfdfeec8c714a07c3e3
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.rap.rwt/src/org/eclipse/swt/browser/Browser.java19
1 files changed, 15 insertions, 4 deletions
diff --git a/bundles/org.eclipse.rap.rwt/src/org/eclipse/swt/browser/Browser.java b/bundles/org.eclipse.rap.rwt/src/org/eclipse/swt/browser/Browser.java
index 4d149550e3..0aa34c3744 100644
--- a/bundles/org.eclipse.rap.rwt/src/org/eclipse/swt/browser/Browser.java
+++ b/bundles/org.eclipse.rap.rwt/src/org/eclipse/swt/browser/Browser.java
@@ -110,10 +110,7 @@ public class Browser extends Composite {
* @see org.eclipse.swt.widgets.Widget#getStyle
*/
public Browser( Composite parent, int style ) {
- super( parent, style );
- if( ( style & ( SWT.MOZILLA | SWT.WEBKIT ) ) != 0 ) {
- throw new SWTError( SWT.ERROR_NO_HANDLES, "Unsupported Browser type" );
- }
+ super( parent, checkStyle( style ) );
html = "";
url = "";
functions = new ArrayList<>();
@@ -514,6 +511,20 @@ public class Browser extends Composite {
return null;
}
+ private static int checkStyle( int style ) {
+ int result = style;
+ if( ( style & ( SWT.MOZILLA | SWT.WEBKIT ) ) != 0 ) {
+ throw new SWTError( SWT.ERROR_NO_HANDLES, "Unsupported Browser type" );
+ }
+ if( ( result & SWT.H_SCROLL ) != 0 ) {
+ result &= ~SWT.H_SCROLL;
+ }
+ if( ( result & SWT.V_SCROLL ) != 0 ) {
+ result &= ~SWT.V_SCROLL;
+ }
+ return result;
+ }
+
//////////////////////////////////////////
// BrowserFunction support helping methods

Back to the top