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

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

Issue 2706193003: FrameView: Remove redundant tree walk when unthrottling display:none frames (Closed)
Patch Set: Enums ftw Created 3 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 29ddba69decec3a8f4fbbd0b60c08dd5bb9df356..6925aea883ffbdf46171af3060c8aa236caa7635 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -4740,7 +4740,11 @@ void FrameView::updateViewportIntersectionsForSubtree(
// Don't throttle display:none frames (see updateRenderThrottlingStatus).
HTMLFrameOwnerElement* ownerElement = m_frame->deprecatedLocalOwner();
if (m_hiddenForThrottling && ownerElement && !ownerElement->layoutObject()) {
- updateRenderThrottlingStatus(m_hiddenForThrottling, m_subtreeThrottled);
+ // No need to notify children because descendants of display:none frames
+ // should remain throttled.
+ updateRenderThrottlingStatus(m_hiddenForThrottling, m_subtreeThrottled,
+ DontForceThrottlingInvalidation,
+ DontNotifyChildren);
DCHECK(!canThrottleRendering());
}
@@ -4761,12 +4765,15 @@ void FrameView::crossOriginStatusChanged() {
// Cross-domain status is not stored as a dirty bit within FrameView,
// so force-invalidate throttling status when it changes regardless of
// previous or new value.
- updateRenderThrottlingStatus(m_hiddenForThrottling, m_subtreeThrottled, true);
+ updateRenderThrottlingStatus(m_hiddenForThrottling, m_subtreeThrottled,
+ ForceThrottlingInvalidation);
}
-void FrameView::updateRenderThrottlingStatus(bool hidden,
- bool subtreeThrottled,
- bool forceThrottlingInvalidation) {
+void FrameView::updateRenderThrottlingStatus(
+ bool hidden,
+ bool subtreeThrottled,
+ ForceThrottlingInvalidationBehavior forceThrottlingInvalidationBehavior,
+ NotifyChildrenBehavior notifyChildrenBehavior) {
TRACE_EVENT0("blink", "FrameView::updateRenderThrottlingStatus");
DCHECK(!isInPerformLayout());
DCHECK(!m_frame->document() || !m_frame->document()->inStyleRecalc());
@@ -4787,7 +4794,9 @@ void FrameView::updateRenderThrottlingStatus(bool hidden,
// paint one of the children with an out-of-date layout before
// |updateRenderThrottlingStatus| has made it throttled or 2) fail to
// unthrottle a child whose parent is unthrottled by a later notification.
- if (wasThrottled != isThrottled || forceThrottlingInvalidation) {
+ if (notifyChildrenBehavior == NotifyChildren &&
+ (wasThrottled != isThrottled ||
+ forceThrottlingInvalidationBehavior == ForceThrottlingInvalidation)) {
for (const Member<Widget>& child : *children()) {
if (child->isFrameView()) {
FrameView* childView = toFrameView(child);
@@ -4798,7 +4807,8 @@ void FrameView::updateRenderThrottlingStatus(bool hidden,
}
ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator();
- if (becameUnthrottled || forceThrottlingInvalidation) {
+ if (becameUnthrottled ||
+ forceThrottlingInvalidationBehavior == ForceThrottlingInvalidation) {
// ScrollingCoordinator needs to update according to the new throttling
// status.
if (scrollingCoordinator)
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698