Bug 548960

Summary: Enable operating system dark mode in swt browser
Product: [Eclipse Project] Platform Reporter: Matthias Becker <ma.becker>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: andrew_johnson, ericwill, niraj.modi
Version: 4.13Keywords: triaged
Target Milestone: ---   
Hardware: All   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=532185
Whiteboard:
Bug Depends on:    
Bug Blocks: 577357    

Description Matthias Becker CLA 2019-07-04 03:34:01 EDT
In https://bugs.eclipse.org/bugs/show_bug.cgi?id=532185 we enhanced the eclipse help system and the help documents so that the prefers-color-scheme media query (see https://drafts.csswg.org/mediaqueries-5/#prefers-color-scheme ) is used there.
With this the help is displayed in dark mode when the OS-level settings are set to "dark mode".

When the help is displayed in the integrated help view the SWT browser widget is used.
In this case the OS-level (or even eclipse "appearance" preferences") don't have an effect on that.

Can this be changed so that the embedded browser also considers these settings?
Comment 1 Eric Williams CLA 2019-08-13 09:21:52 EDT
Do you have an example snippet or use case that shows this bug? I.e. some place where the browser isn't properly themed because of this bug?
Comment 2 Andrew Johnson CLA 2020-10-02 05:13:03 EDT
This causes a problem for Eclipse Memory Analyzer.
The tool builds HTML reports which it displays using the SWT browser.
On Windows the SWT internal browser does not handle the CSS:

@media screen and (prefers-color-scheme: dark) {

nor does it handle:

img {
  filter: invert(100%) hue-rotate(180deg);
}

The first is useful to automatically change the style sheet.
The second is a neat way of fixing coloured charts - white goes to black, black to white, and with the hue rotate dark blue goes to light blue and vice versa etc., so charts look normal.

I can work around the first by copying a different style sheet when in dark mode.
I don't think I can fix the second without having new image files.

See bug 567533
Comment 3 Andrew Johnson CLA 2020-10-05 04:53:32 EDT
I think this is a Windows problem with the internal "ie" browser as it works for Memory Analyzer based off 2020-03 running on Ubuntu (via Docker). 

If this is confirmed we could update the Hardware fields for this bug.