CEF 3071 OSR views: background is back to white (Windows)

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

CEF 3071 OSR views: background is back to white (Windows)

Postby ebahar » Thu Jun 29, 2017 6:26 am

Hi,

in CEF branch 3071 (chromium 59) there is an issue with OSR background color:
in case open view devtools (you may need to hover some elements) and then closing it
the view background color is chanting from transparent to white.

after digging in to it, i found a solution for that (when devtools detaching from view ,
it's clearing the background color to default which is White) :

at src\content\renderer\render_view_impl.cc
void RenderViewImpl::AttachWebFrameWidget(blink::WebFrameWidget* frame_widget) {
// The previous WebFrameWidget must already be detached by CloseForFrame().
DCHECK(!frame_widget_);
frame_widget_ = frame_widget;
// FIX OSR background color //
if (frame_widget_)
frame_widget_->SetBaseBackgroundColor(webkit_preferences_.base_background_color); /// < 0000000000000
// END FIX
}
ebahar
Techie
 
Posts: 46
Joined: Tue Nov 22, 2016 3:52 am

Re: CEF 3071 OSR views: background is back to white (Windows

Postby magreenblatt » Thu Jun 29, 2017 10:04 am

ebahar wrote:after digging in to it, i found a solution for that (when devtools detaching from view ,
it's clearing the background color to default which is White)

Where is this clearing happening?
magreenblatt
Site Admin
 
Posts: 12402
Joined: Fri May 29, 2009 6:57 pm

Re: CEF 3071 OSR views: background is back to white (Windows

Postby ebahar » Sun Jul 02, 2017 4:41 am

Code: Select all
Response InspectorEmulationAgent::disable() {
  setScriptExecutionDisabled(false);
  setTouchEmulationEnabled(false, Maybe<String>());
  setEmulatedMedia(String());
  setCPUThrottlingRate(1);
  resetViewport();
  setDefaultBackgroundColorOverride(Maybe<protocol::DOM::RGBA>());  // <---- trigger clearing background color
  return Response::OK();
}


call stack:
libcef.dll!blink::WebViewImpl::BaseBackgroundColor() Line 3573 C++ <---- this is where the background color been cleared
libcef.dll!blink::WebViewImpl::UpdateBaseBackgroundColor() Line 3623 C++
libcef.dll!blink::InspectorEmulationAgent::setDefaultBackgroundColorOverride(blink::protocol::Maybe<blink::protocol::DOM::RGBA> color) Line 196 C++
> libcef.dll!blink::InspectorEmulationAgent::disable() Line 91 C++
ebahar
Techie
 
Posts: 46
Joined: Tue Nov 22, 2016 3:52 am

Re: CEF 3071 OSR views: background is back to white (Windows

Postby magreenblatt » Sun Jul 02, 2017 9:48 am

Thanks for the info. Please add a bug.
magreenblatt
Site Admin
 
Posts: 12402
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 31 guests