Bug 571278 - [Edge] Empty java-doc hover tool-tip with Edge browser in Eclipse
Summary: [Edge] Empty java-doc hover tool-tip with Edge browser in Eclipse
Status: CLOSED MOVED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.19   Edit
Hardware: PC Windows 10
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on: 538991
Blocks: 575660 571909 573985
  Show dependency tree
 
Reported: 2021-02-18 02:08 EST by Niraj Modi CLA
Modified: 2022-06-20 02:39 EDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Niraj Modi CLA 2021-02-18 02:08:00 EST
Raising bug to capture open issues discussed in https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/174084

When using Edge as default browser in Eclipse, below issues are seen:
1. Notice blank JavaDoc hover in Eclipse:
https://bugs.eclipse.org/bugs/attachment.cgi?id=285441

>> IE uses about:blank for Browser.setText, Edge uses data: URLs. It seems that JDT doesn't expect to see a data: URL. As I mentioned earlier, correct URL for setData pages is undefined and browser-specific.


2. Also the welcome page has missing color and styling:
https://bugs.eclipse.org/bugs/attachment.cgi?id=285442

>> The lack of styling is because http: and data: pages (which includes Browser.setText pages) can't access file:// resources. This seems to be by design, see https://github.com/MicrosoftEdge/WebView2Feedback/issues/456
Comment 1 D Jean-François CLA 2021-08-30 09:13:19 EDT
Hello,

We have an application using SWT and the Browser object. 
There is a mix between SWT objects and html rendrered by the Browser object.


This application is used by more than 1000 users and we need to stop depending on Internet Explorer... 

Thats why we started to use the SWT.EDGE browser based on Webview2, instead of the default IE browser. 

Big thanks to the eclipse team who implemented the solution.

Unfortunately, we have a "non reproductible" but very frequent problem : the mouse pointer disappears for the whole SWT application. It is still possible to click and use the mouse but it's invisible. For the other applications the cursor is visible. We are using Windows OS only.

We are sure this happens only when the new Edge Chromium browser object is used.

By any chance, do you have any idea of what could cause this ?

Really sorry that I cannot provide something to reproduce it, I even cannot reproduce it on my own computer, but it happens for our users.

Thank you... :-)
Comment 2 D Jean-François CLA 2021-09-03 03:11:08 EDT
The mouse disappearing problem is probably related to Chromium itself when using a touchscreen https://bugs.chromium.org/p/chromium/issues/detail?id=451965
Comment 3 D Jean-François CLA 2021-09-20 10:50:18 EDT
The cursor must go over an Edge browser element to be visible again.

If this can help anyone, I used a workarround : 

1) set the position of the mouse cursor over the browser object when it is touched (detected with javascript) 

2) set the position of the mouse cursor over a always-visible browser element, if a browser is destroyed (possible from a popup), and no mouse-move detected (also detected with JS)
Comment 4 Phil Beauvoir CLA 2021-10-10 04:54:54 EDT
Some feedback...

I added Edge support to our RCP app, Archi. On Windows 10 the user has to ensure that Edge WebView2 Runtime in installed. On Windows 11 the Runtime is installed by default, so nothing for the end user to do.

We set Edge use globally using org.eclipse.swt.browser.DefaultType=edge so that the Help system uses it too.

We use the internal browser in 4 cases

1. A Welcome screen (org.eclipse.ui.intro)
2. Eclipse's Help System
3. Preview of local HTML pages
4. Preview of locally constructed HTML text strings

(1) leads to BrowserIntroPartImplementation calling Browser#setText() and so local images and CSS file are not loaded as noted in Comment #1. As we only have one welcome page I embedded the style css and converted images to embedded Bas64 strings into the single HTML page. Perhaps BrowserIntroPartImplementation could construct a temporary local html file instead of calling Browser#setText()? Or construct one html file with everything embedded?

(2) works just fine and falls back to the external browser if WebView2 Runtime is not installed

(3) works just fine as long as local URLs are prefixed with "file:///"

(4) works fine as long as there are no links to local JS/CSS/Image resources. Same comments as (1)

But overall, great! Thanks!
Comment 5 Phil Beauvoir CLA 2021-10-10 05:20:16 EDT
One more comment.

On Windows 11 a fallback browser used if org.eclipse.swt.browser.DefaultType=edge is not specified. Not sure what it is but looks like a cross between IE11 and Edge.
Comment 6 Geoffrey Longo CLA 2022-01-26 10:02:10 EST
Any news on fixing the empty javadoc hover tooltip that occurs when using the Edge browser (org.eclipse.swt.browser.DefaultType=edge)?  Our application can not rely on IE any longer. Do we need a specific bug for this to be addressed?
Comment 7 Niraj Modi CLA 2022-02-11 11:03:00 EST
(In reply to Niraj Modi from comment #0)
> Raising bug to capture open issues discussed in
> https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/174084

> 2. Also the welcome page has missing color and styling:
> https://bugs.eclipse.org/bugs/attachment.cgi?id=285442
> 
> >> The lack of styling is because http: and data: pages (which includes Browser.setText pages) can't access file:// resources. This seems to be by design, see https://github.com/MicrosoftEdge/WebView2Feedback/issues/456

Raised separate bug 578700 to track above issue.
Comment 8 Nikita Nemkin CLA 2022-02-18 05:30:37 EST
Edge is a VERY heavyweight component, like 7 extra processes heavyweight. It really shouldn't be used for tooltips, which only require basic HTML rendering.

I suggest explicitly requesting IE backend for Browser instances in tooltips.

A better long term fix would be migrating tooltips to StyledText or a platform-specific rich text component.
Comment 9 Niraj Modi CLA 2022-06-14 06:42:20 EDT
(In reply to Nikita Nemkin from comment #8)
> Edge is a VERY heavyweight component, like 7 extra processes heavyweight. It
> really shouldn't be used for tooltips, which only require basic HTML
> rendering.
> 
IMO, Edge being chromium based so the concept of process is carried forward.

We feel that let's tryout Edge in Eclipse JavaDoc tooltip and see how heavy it's feels in real world(Is it only the number of processes that come into picture and we also need to see how much memory they consumes). Can be evaluated in our testing.

So, idea is to get Edge implementation more close to IE from Eclipse point of view:
- On a side note we should also check: if there are some flags using which, we can remove the extra processes.

> I suggest explicitly requesting IE backend for Browser instances in tooltips.

We take a call after trying the Edge based JavaDoc tooltip.
Open to inputs on this hybrid approach:
- Have concerns on how it will work without IE present on the machine

> A better long term fix would be migrating tooltips to StyledText or a
> platform-specific rich text component.

Nice idea that needs to evolve.