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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 #include "core/loader/FrameLoaderClient.h" 73 #include "core/loader/FrameLoaderClient.h"
74 #include "core/page/AutoscrollController.h" 74 #include "core/page/AutoscrollController.h"
75 #include "core/page/ChromeClient.h" 75 #include "core/page/ChromeClient.h"
76 #include "core/page/FocusController.h" 76 #include "core/page/FocusController.h"
77 #include "core/page/FrameTree.h" 77 #include "core/page/FrameTree.h"
78 #include "core/page/Page.h" 78 #include "core/page/Page.h"
79 #include "core/page/scrolling/ScrollingCoordinator.h" 79 #include "core/page/scrolling/ScrollingCoordinator.h"
80 #include "core/paint/FramePainter.h" 80 #include "core/paint/FramePainter.h"
81 #include "core/paint/PaintLayer.h" 81 #include "core/paint/PaintLayer.h"
82 #include "core/paint/PaintPropertyTreeBuilder.h" 82 #include "core/paint/PaintPropertyTreeBuilder.h"
83 #include "core/plugins/PluginView.h"
83 #include "core/style/ComputedStyle.h" 84 #include "core/style/ComputedStyle.h"
84 #include "core/svg/SVGDocumentExtensions.h" 85 #include "core/svg/SVGDocumentExtensions.h"
85 #include "core/svg/SVGSVGElement.h" 86 #include "core/svg/SVGSVGElement.h"
86 #include "platform/HostWindow.h" 87 #include "platform/HostWindow.h"
87 #include "platform/RuntimeEnabledFeatures.h" 88 #include "platform/RuntimeEnabledFeatures.h"
88 #include "platform/ScriptForbiddenScope.h" 89 #include "platform/ScriptForbiddenScope.h"
89 #include "platform/TraceEvent.h" 90 #include "platform/TraceEvent.h"
90 #include "platform/TracedValue.h" 91 #include "platform/TracedValue.h"
91 #include "platform/fonts/FontCache.h" 92 #include "platform/fonts/FontCache.h"
92 #include "platform/geometry/DoubleRect.h" 93 #include "platform/geometry/DoubleRect.h"
(...skipping 2335 matching lines...) Expand 10 before | Expand all | Expand 10 after
2428 void FrameView::scheduleVisualUpdateForPaintInvalidationIfNeeded() 2429 void FrameView::scheduleVisualUpdateForPaintInvalidationIfNeeded()
2429 { 2430 {
2430 LocalFrame* localFrameRoot = frame().localFrameRoot(); 2431 LocalFrame* localFrameRoot = frame().localFrameRoot();
2431 if (!localFrameRoot->view()->m_isUpdatingAllLifecyclePhases || lifecycle().s tate() >= DocumentLifecycle::PaintInvalidationClean) { 2432 if (!localFrameRoot->view()->m_isUpdatingAllLifecyclePhases || lifecycle().s tate() >= DocumentLifecycle::PaintInvalidationClean) {
2432 // Schedule visual update to process the paint invalidation in the next cycle. 2433 // Schedule visual update to process the paint invalidation in the next cycle.
2433 localFrameRoot->scheduleVisualUpdateUnlessThrottled(); 2434 localFrameRoot->scheduleVisualUpdateUnlessThrottled();
2434 } 2435 }
2435 // Otherwise the paint invalidation will be handled in paint invalidation ph ase of this cycle. 2436 // Otherwise the paint invalidation will be handled in paint invalidation ph ase of this cycle.
2436 } 2437 }
2437 2438
2439 // TODO(leviw): We don't assert lifecycle information from documents in child Pl uginViews.
2438 void FrameView::updateLifecyclePhasesInternal(LifeCycleUpdateOption phases) 2440 void FrameView::updateLifecyclePhasesInternal(LifeCycleUpdateOption phases)
2439 { 2441 {
2440 Optional<TemporaryChange<bool>> isUpdatingAllLifecyclePhasesScope; 2442 Optional<TemporaryChange<bool>> isUpdatingAllLifecyclePhasesScope;
2441 if (phases == AllPhases) 2443 if (phases == AllPhases)
2442 isUpdatingAllLifecyclePhasesScope.emplace(m_isUpdatingAllLifecyclePhases , true); 2444 isUpdatingAllLifecyclePhasesScope.emplace(m_isUpdatingAllLifecyclePhases , true);
2443 2445
2444 // This must be called from the root frame, since it recurses down, not up. 2446 // This must be called from the root frame, since it recurses down, not up.
2445 // Otherwise the lifecycles of the frames might be out of sync. 2447 // Otherwise the lifecycles of the frames might be out of sync.
2446 ASSERT(m_frame->isLocalRoot()); 2448 ASSERT(m_frame->isLocalRoot());
2447 2449
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
2615 // pointless (since those frames will have set a zero timer to layout anyway ), but 2617 // pointless (since those frames will have set a zero timer to layout anyway ), but
2616 // it is also incorrect, since if two frames overlap, the first could be exc luded from the dirty 2618 // it is also incorrect, since if two frames overlap, the first could be exc luded from the dirty
2617 // region but then become included later by the second frame adding rects to the dirty region 2619 // region but then become included later by the second frame adding rects to the dirty region
2618 // when it lays out. 2620 // when it lays out.
2619 2621
2620 m_frame->document()->updateLayoutTreeIfNeeded(); 2622 m_frame->document()->updateLayoutTreeIfNeeded();
2621 2623
2622 if (needsLayout()) 2624 if (needsLayout())
2623 layout(); 2625 layout();
2624 2626
2627 // WebView plugins need to update regardless of whether the LayoutEmbeddedOb ject
2628 // that owns them needed layout.
2629 // TODO(leviw): This currently runs the entire lifecycle on plugin WebViews. We
2630 // should have a way to only run these other Documents to the same lifecycle stage
2631 // as this frame.
2632 const ChildrenWidgetSet* viewChildren = children();
2633 for (const RefPtrWillBeMember<Widget>& child : *viewChildren) {
2634 if ((*child).isPluginContainer())
2635 toPluginView(child.get())->layoutIfNeeded();
2636 }
2637
2625 // FIXME: Calling layout() shouldn't trigger script execution or have any 2638 // FIXME: Calling layout() shouldn't trigger script execution or have any
2626 // observable effects on the frame tree but we're not quite there yet. 2639 // observable effects on the frame tree but we're not quite there yet.
2627 WillBeHeapVector<RefPtrWillBeMember<FrameView>> frameViews; 2640 WillBeHeapVector<RefPtrWillBeMember<FrameView>> frameViews;
2628 for (Frame* child = m_frame->tree().firstChild(); child; child = child->tree ().nextSibling()) { 2641 for (Frame* child = m_frame->tree().firstChild(); child; child = child->tree ().nextSibling()) {
2629 if (!child->isLocalFrame()) 2642 if (!child->isLocalFrame())
2630 continue; 2643 continue;
2631 if (FrameView* view = toLocalFrame(child)->view()) 2644 if (FrameView* view = toLocalFrame(child)->view())
2632 frameViews.append(view); 2645 frameViews.append(view);
2633 } 2646 }
2634 2647
(...skipping 1462 matching lines...) Expand 10 before | Expand all | Expand 10 after
4097 return m_hiddenForThrottling && m_crossOriginForThrottling; 4110 return m_hiddenForThrottling && m_crossOriginForThrottling;
4098 } 4111 }
4099 4112
4100 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const 4113 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const
4101 { 4114 {
4102 ASSERT(layoutView()); 4115 ASSERT(layoutView());
4103 return *layoutView(); 4116 return *layoutView();
4104 } 4117 }
4105 4118
4106 } // namespace blink 4119 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698