Bug 187646 - [WPE] Provide API to configure the default page background
Summary: [WPE] Provide API to configure the default page background
Status: RESOLVED DUPLICATE of bug 192305
Alias: None
Product: WebKit
Classification: Unclassified
Component: WPE WebKit (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-13 08:28 PDT by Adrian Perez
Modified: 2019-03-18 06:12 PDT (History)
4 users (show)

See Also:


Attachments
Patch which hardcodes black as background (6.12 KB, patch)
2018-07-13 08:32 PDT, Adrian Perez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Perez 2018-07-13 08:28:32 PDT
In the GTK+ port there is the following in the API:

  void
  webkit_web_view_set_background_color (WebKitWebView *web_view,
                                        const GdkRGBA *rgba);

but in WPE there is no equivalent function. Having something similar
would be handy in certain scenarios, to avoid flashing white frames
while content is being loaded. For example:

  1. A device boots with a splash screen, which has a dark background.
  2. Right after boot, a program using WPE is launched, and starts
     loading some content. This is designed to have the same
     background color as the splash screen.
  3. The content takes some time to complete loading, and during
     this time WebKit may render a few frames which are white (or
     almost completely white), while the styling for the content
     is not yet available.
  4. The Web content finishes loading, and goes back to using the
     same dark background as the splash screen.

This way, step (3.) causes the device screen to produce a white
flash, even if the Web content is loaded quite fast.
Comment 1 Adrian Perez 2018-07-13 08:32:22 PDT
Created attachment 344945 [details]
Patch which hardcodes black as background

As an example, this is a patch which changes Color::white to
Color::black in a few places to avoid the white flash for a
device I am working with at the moment. It could be that there
is a better way, but this is working well for me right now.

IMHO there is value in providing API for this, I can easily
imagine more situations in which setting the background may
be useful.
Comment 2 Miguel Gomez 2019-01-23 07:01:14 PST
Adri, can close this as duplicate of bug 192305? (I know this is older, but the other one has the fix)
Comment 3 Philippe Normand 2019-03-18 06:12:39 PDT
Yep, a dupe indeed. Sorry I've just noticed this bug and didn't reuse it for the bg-color patch :)

*** This bug has been marked as a duplicate of bug 192305 ***