Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6847)

Unified Diff: components/plugins/renderer/webview_plugin.cc

Issue 1244113003: Set needsLayout on WebViewPlugin's container when initialized (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment added. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/plugins/renderer/webview_plugin.cc
diff --git a/components/plugins/renderer/webview_plugin.cc b/components/plugins/renderer/webview_plugin.cc
index 9d2ac91d5956fb458eb892adb7650ec5dd9046f5..c8ef592e3d301c14b5c6abb4ff236ffc23305f6f 100644
--- a/components/plugins/renderer/webview_plugin.cc
+++ b/components/plugins/renderer/webview_plugin.cc
@@ -112,6 +112,15 @@ WebPluginContainer* WebViewPlugin::container() const { return container_; }
bool WebViewPlugin::initialize(WebPluginContainer* container) {
container_ = container;
if (container_) {
+ // We must call layout again here to ensure that the container is laid
+ // out before we next try to paint it, which is a requirement of the
+ // document life cycle in Blink. In most cases, needsLayout is set by
+ // scheduleAnimation, but due to timers controlling widget update,
+ // scheduleAnimation may be invoked before this initialize call (which
+ // comes through the widget update process). It doesn't hurt to mark
+ // for layout again, and it does help us in the race-condition situation.
+ container_->setNeedsLayout();
+
old_title_ = container_->element().getAttribute("title");
// Propagate device scale to inner webview to load the correct resource
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698