Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Furnadjiev2016-04-07 07:44:28 -0400
committerIvan Furnadjiev2016-04-07 07:44:28 -0400
commit82558b92a308b109725c4310ee938eb3137c6e0f (patch)
tree6ca5da7875ef8003eec1c67aca23d30752868f11
parentf5328369f57449744c9f15018ba4d79a4c3ede25 (diff)
downloadorg.eclipse.rap-82558b92a308b109725c4310ee938eb3137c6e0f.tar.gz
org.eclipse.rap-82558b92a308b109725c4310ee938eb3137c6e0f.tar.xz
org.eclipse.rap-82558b92a308b109725c4310ee938eb3137c6e0f.zip
Fix text selection in Browser widget under IE
To suppress text selection a non standard property "-user-select" is used. According to MDN, none/text/all values are supported. To enable text selection after it is disabled, this property must be reset to "text". Enable text selection in Browser widget. Render "text" instead of empty string when text selection is eanbled. 484637: Marking and copying text from Browser widget does not work in IE https://bugs.eclipse.org/bugs/show_bug.cgi?id=484637 Change-Id: I4af35554a11139f86a4f39d59d7aae9f9d7ef828
-rw-r--r--bundles/org.eclipse.rap.rwt/js/rwt/widgets/Browser.js3
-rw-r--r--bundles/org.eclipse.rap.rwt/js/rwt/widgets/base/Widget.js2
-rw-r--r--tests/org.eclipse.rap.rwt.jstest/js/org/eclipse/rwt/test/tests/BrowserTest.js10
3 files changed, 12 insertions, 3 deletions
diff --git a/bundles/org.eclipse.rap.rwt/js/rwt/widgets/Browser.js b/bundles/org.eclipse.rap.rwt/js/rwt/widgets/Browser.js
index 123d26bd80..78d53355b7 100644
--- a/bundles/org.eclipse.rap.rwt/js/rwt/widgets/Browser.js
+++ b/bundles/org.eclipse.rap.rwt/js/rwt/widgets/Browser.js
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2015 Innoopract Informationssysteme GmbH and others.
+ * Copyright (c) 2007, 2016 Innoopract Informationssysteme GmbH and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,6 +19,7 @@ rwt.qx.Class.define( "rwt.widgets.Browser", {
this._browserFunctions = {};
// TODO [rh] preliminary workaround to make Browser accessible by tab
this.setTabIndex( 1 );
+ this.setSelectable( true );
this.setAppearance( "browser" );
this.addEventListener( "create", this._onCreate, this );
},
diff --git a/bundles/org.eclipse.rap.rwt/js/rwt/widgets/base/Widget.js b/bundles/org.eclipse.rap.rwt/js/rwt/widgets/base/Widget.js
index 9a1d8b6a1d..62bc937f1d 100644
--- a/bundles/org.eclipse.rap.rwt/js/rwt/widgets/base/Widget.js
+++ b/bundles/org.eclipse.rap.rwt/js/rwt/widgets/base/Widget.js
@@ -3209,7 +3209,7 @@ rwt.qx.Class.define( "rwt.widgets.base.Widget", {
// SELECTABLE SUPPORT
_applySelectable : function( value ) {
- rwt.html.Style.setUserSelect( this, value ? "" : "none" );
+ rwt.html.Style.setUserSelect( this, value ? "text" : "none" );
},
//////////////////
diff --git a/tests/org.eclipse.rap.rwt.jstest/js/org/eclipse/rwt/test/tests/BrowserTest.js b/tests/org.eclipse.rap.rwt.jstest/js/org/eclipse/rwt/test/tests/BrowserTest.js
index 605e4eafab..bc0193f6d8 100644
--- a/tests/org.eclipse.rap.rwt.jstest/js/org/eclipse/rwt/test/tests/BrowserTest.js
+++ b/tests/org.eclipse.rap.rwt.jstest/js/org/eclipse/rwt/test/tests/BrowserTest.js
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2015 EclipseSource and others.
+ * Copyright (c) 2010, 2016 EclipseSource and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -129,6 +129,14 @@ rwt.qx.Class.define( "org.eclipse.rwt.test.tests.BrowserTest", {
assertNull( domain3 );
},
+ testBrowserIsSelectable : function() {
+ var browser = this._createBrowser();
+
+ assertTrue( browser.getSelectable() );
+ assertEquals( "text", rwt.html.Style.getUserSelect( browser.getElement() ) );
+ browser.destroy();
+ },
+
testExecute : [
function() {
var browser = this._createBrowser();

Back to the top