Skip to main content
diff options
authorSimeon Andreev2022-01-13 15:26:26 +0000
committerAndrey Loskutov2022-01-14 17:16:20 +0000
commit663a6e5f991dce44e8d68ef1007e086e051b2778 (patch)
parent19d29ce7bcfd4793649398e414de200c4d607ef6 (diff)
When resizing a JavaDoc hover, the horizontal scrollbar painting is broken if GTK overlay scrollbars are disabled. This change specifies word-wrap instead of scrolling upon text overflow, for the .html of the JavaDoc hover. This change is applied only if the OS is Linux. Change-Id: Icc4f3160f1fd64095ded1178448cb5c2906fd9d6 Signed-off-by: Simeon Andreev <> Reviewed-on: Tested-by: Platform Bot <> Reviewed-by: Andrey Loskutov <>
1 files changed, 8 insertions, 2 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/ b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/
index f08f6fa2f2c..b3640458e82 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/
@@ -42,6 +42,7 @@ import org.eclipse.core.runtime.ListenerList;
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.util.Util;
import org.eclipse.jface.text.AbstractInformationControl;
import org.eclipse.jface.text.IDelayedInputChangeProvider;
@@ -288,11 +289,16 @@ public class BrowserInformationControl extends AbstractInformationControl implem
boolean RTL= (getShell().getStyle() & SWT.RIGHT_TO_LEFT) != 0;
boolean resizable= isResizable();
+ String scrollbarStyle= "overflow:scroll;"; //$NON-NLS-1$
+ // workaround for bug 546870, don't use a horizontal scrollbar on Linux as its broken for GTK3 and WebKit
+ if (Util.isLinux()) {
+ scrollbarStyle= "word-wrap:break-word;"; //$NON-NLS-1$
+ }
// The default "overflow:auto" would not result in a predictable width for the client area
// and the re-wrapping would cause visual noise
String[] styles= null;
if (RTL && resizable)
- styles= new String[] { "direction:rtl;", "overflow:scroll;", "word-wrap:break-word;" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ styles= new String[] { "direction:rtl;", scrollbarStyle, "word-wrap:break-word;" }; //$NON-NLS-1$ //$NON-NLS-2$
else if (RTL && !resizable)
styles= new String[] { "direction:rtl;", "overflow:hidden;", "word-wrap:break-word;" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
else if (!resizable)
@@ -300,7 +306,7 @@ public class BrowserInformationControl extends AbstractInformationControl implem
// Re-check whether we really still need this now that the Javadoc Hover header already sets this style.
styles= new String[] { "overflow:hidden;"/*, "word-wrap: break-word;"*/}; //$NON-NLS-1$
- styles= new String[] { "overflow:scroll;" }; //$NON-NLS-1$
+ styles= new String[] { scrollbarStyle };
StringBuilder buffer= new StringBuilder(content);
HTMLPrinter.insertStyles(buffer, styles);

Back to the top