Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 318243

Summary: Javadoc does not render properly with WebKitGTK
Product: [Eclipse Project] JDT Reporter: Grant Gayed <grant_gayed>
Component: UIAssignee: Markus Keller <markus.kell.r>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, deepakazad, markus.kell.r
Version: 3.6Flags: daniel_megert: review+
Target Milestone: ---   
Hardware: PC   
OS: Linux-GTK   
Whiteboard:
Attachments:
Description Flags
Fix none

Description Grant Gayed CLA 2010-06-28 16:28:06 EDT
There is a bug in WebKitGTK+ with resolving the InfoText colour, see https://bugs.webkit.org/show_bug.cgi?id=41296 .  This bug causes links JDT's links that use this style to not appear properly in the Javadoc view and hovers.  WebKitGTK is now the Browser's default renderer on GTK (assuming it's found on the machine), so a workaround for this WebKitGTK bug is needed in JDT.

The lines that are causing the problem are:
a.header:link    { text-decoration: none; color: InfoText }
a.header:visited { text-decoration: none; color: InfoText }

Can JDT omit these two lines when Browser.getBrowserType() is "webkit" and SWT.getPlatform() is "gtk"?
Comment 1 Markus Keller CLA 2010-06-29 05:21:34 EDT
We can't omit the declarations, since that would e.g. break default Ubuntu installs with their white-on-black tooltips. But we could replace them with values from SWT.COLOR_INFO_FOREGROUND for WebKit.

Do you know if it's possible to change the tooltip fg/bg colors on Mac OS X?
WebKit could have the same problem there.

If I got that right, WebKitGTK is already officially supported in 3.6 (but it's not the default there), so I guess this should also be backported to 3.6.1, right?

I'll look at this together with bug 313530.
Comment 2 Grant Gayed CLA 2010-06-29 12:52:11 EDT
I don't believe there's a way to change these colours on OS X, they're not in the System Preferences or in the "defaults" command line app.

Yes, WebKitGTK is supported (but not default) in 3.6, so a 3.6.1 fix would be ideal since this shows itself readily in eclipse, thanks!
Comment 3 Grant Gayed CLA 2010-07-14 10:46:52 EDT
To update, WebKitGTK is now the default Browser renderer in the 3.7 stream, so this will now appear readily in integration builds as of yesterday's.
Comment 4 Markus Keller CLA 2010-07-26 11:04:01 EDT
Created attachment 175226 [details]
Fix

Fix replaces InfoText with the color from SWT.COLOR_INFO_FOREGROUND. The implementation makes sure the color is updated when the OS Settings changed.
Comment 5 Markus Keller CLA 2010-07-26 11:10:42 EDT
The fix also fixes another issue with wrong colors in Java source hovers. When the hover bg color has too little contrast w.r.t. the editor text fg color, we fall back to using the editor bg color. The fallback didn't work reliably when the editor bg color is the system default color.

Committed to HEAD.

Dani, can you please review for 3.6.1? Note that the fix requires bug 313530.
Comment 6 Dani Megert CLA 2010-07-28 02:42:50 EDT
> The fallback didn't work reliably when
>the editor bg color is the system default color.
This part of the patch is good for 3.6.1.

For the other part I have another idea which I'd like to discuss.
Comment 7 Markus Keller CLA 2010-08-02 14:05:38 EDT
In HEAD, I've reverted the changes in JavadocHover, JavadocView, and AbstractJavaCompletionProposal. HTMLPrinter#appendStyleSheet(..) now takes care of replacing InfoText and InfoBackground with static colors.

=> 3.6.1 only needs changes in HTMLPrinter and SourceViewerInformationControl.
Comment 8 Dani Megert CLA 2010-08-03 08:17:53 EDT
The latest fix is not yet 100% complete, see bug 321581.
Comment 9 Markus Keller CLA 2010-08-03 09:16:21 EDT
> The latest fix is not yet 100% complete, see bug 321581.

Not a big deal and has always been like that, so I don't think we should backport bug 321581 to 3.6.1.
Comment 10 Dani Megert CLA 2010-08-03 10:06:45 EDT
>Not a big deal and has always been like that, so I don't think we should
>backport bug 321581 to 3.6.1.
If we say that hot update is important enough to backport then the backport must be correct and hence bug 321581 is also important enough to be backported.
Comment 11 Markus Keller CLA 2010-08-03 10:48:54 EDT
(In reply to comment #10)
The question is whether the system is usable after the settings have been changed. Javadoc hovers are not usable any more until you restart Eclipse, that's what that needs to be fixed. Background of the hint text is minor and corrects itself, that's why this should only be backported if trivial.


(In reply to comment #7)
> => 3.6.1 only needs changes in HTMLPrinter and SourceViewerInformationControl.
And in JavaEditorAppearanceConfigurationBlock, see bug 313943.
Comment 12 Dani Megert CLA 2010-08-03 12:24:20 EDT
(In reply to comment #11)
> (In reply to comment #10)
> The question is whether the system is usable after the settings have been
> changed. Javadoc hovers are not usable any more until you restart Eclipse,
> that's what that needs to be fixed.
Good point.

> Background of the hint text is minor and
> corrects itself, that's why this should only be backported if trivial.
Agreed!

> 
> 
> (In reply to comment #7)
> > => 3.6.1 only needs changes in HTMLPrinter and SourceViewerInformationControl.
> And in JavaEditorAppearanceConfigurationBlock, see bug 313943.

I suggest you open a new bug for 3.6.1 with a patch.
Comment 13 Markus Keller CLA 2010-08-17 10:49:37 EDT
Will be fixed in 3.6.1 with the fix for bug 313530.

*** This bug has been marked as a duplicate of bug 313530 ***
Comment 14 Dani Megert CLA 2010-08-19 02:23:16 EDT
+1 for 3.6.1 RC2.