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

Unified Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 1708923002: Ensure WebView plugins run their lifecycle even absent main frame Layout (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert to disabling stylesheet Created 4 years, 10 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
Index: third_party/WebKit/Source/core/frame/FrameView.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index 6bd87f905f2b4739a9110fcb63b3ab66bf9c762e..b1fd652550f850a14b1f3f046497d1a5ea42926f 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -80,6 +80,7 @@
#include "core/paint/FramePainter.h"
#include "core/paint/PaintLayer.h"
#include "core/paint/PaintPropertyTreeBuilder.h"
+#include "core/plugins/PluginView.h"
#include "core/style/ComputedStyle.h"
#include "core/svg/SVGDocumentExtensions.h"
#include "core/svg/SVGSVGElement.h"
@@ -2435,6 +2436,7 @@ void FrameView::scheduleVisualUpdateForPaintInvalidationIfNeeded()
// Otherwise the paint invalidation will be handled in paint invalidation phase of this cycle.
}
+// TODO(leviw): We don't assert lifecycle information from documents in child PluginViews.
void FrameView::updateLifecyclePhasesInternal(LifeCycleUpdateOption phases)
{
Optional<TemporaryChange<bool>> isUpdatingAllLifecyclePhasesScope;
@@ -2622,6 +2624,17 @@ void FrameView::updateStyleAndLayoutIfNeededRecursive()
if (needsLayout())
layout();
+ // WebView plugins need to update regardless of whether the LayoutEmbeddedObject
+ // that owns them needed layout.
+ // TODO(leviw): This currently runs the entire lifecycle on plugin WebViews. We
+ // should have a way to only run these other Documents to the same lifecycle stage
+ // as this frame.
+ const ChildrenWidgetSet* viewChildren = children();
+ for (const RefPtrWillBeMember<Widget>& child : *viewChildren) {
+ if ((*child).isPluginContainer())
+ toPluginView(child.get())->layoutIfNeeded();
+ }
+
// FIXME: Calling layout() shouldn't trigger script execution or have any
// observable effects on the frame tree but we're not quite there yet.
WillBeHeapVector<RefPtrWillBeMember<FrameView>> frameViews;

Powered by Google App Engine
This is Rietveld 408576698