Commit 967c1814 authored by Scott Violet's avatar Scott Violet Committed by Commit Bot

views: Makes WebView force synchronous layout in some situations

It turns out pepper expects a call to fullscreen to synchronously
change the bounds. Recent changes to NativeViewHost meant that
Attach() did not synchronously change the bounds, which broke
pepper fullscreen. This patch makes WebView call Layout() right
after Attach() to ensure the bounds are up to date for pepper.

BUG=959118
TEST=none

Change-Id: I35d4461347557735af9b19dab58c2bd2d71b733d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1633830Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664486}
parent 514383cf
...@@ -363,6 +363,11 @@ void WebView::AttachWebContents() { ...@@ -363,6 +363,11 @@ void WebView::AttachWebContents() {
return; return;
holder_->Attach(view_to_attach); holder_->Attach(view_to_attach);
// Attach() asynchronously sets the bounds of the widget. Pepper expects
// fullscreen widgets to be sized immediately, so force a layout now.
// See https://crbug.com/361408 and https://crbug.com/id=959118.
if (is_embedding_fullscreen_widget_)
holder_->Layout();
// We set the parent accessible of the native view to be our parent. // We set the parent accessible of the native view to be our parent.
if (parent()) if (parent())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment