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

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

Issue 2658063002: FrameView: Don't throttle display:none frames (Closed)
Patch Set: Created 3 years, 11 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 | third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 530e1224f1a96424eb13c66f5798ccacf1afc45d..546a64a6a084e5a0526d54d8bdb954fa5b0a55a9 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -4642,6 +4642,13 @@ void FrameView::updateViewportIntersectionsForSubtree(
->intersectionObserverController()
->computeTrackedIntersectionObservations();
+ // Don't throttle display:none frames (see updateRenderThrottlingStatus).
+ HTMLFrameOwnerElement* ownerElement = m_frame->deprecatedLocalOwner();
+ if (m_hiddenForThrottling && ownerElement && !ownerElement->layoutObject()) {
+ updateRenderThrottlingStatus(m_hiddenForThrottling, m_subtreeThrottled);
esprehn 2017/02/14 00:05:21 This introduces an entire frame tree walk down her
Sami 2017/02/21 12:34:03 Well spotted -- fix here: https://codereview.chrom
+ DCHECK(!canThrottleRendering());
+ }
+
for (Frame* child = m_frame->tree().firstChild(); child;
child = child->tree().nextSibling()) {
if (!child->isLocalFrame())
@@ -4662,9 +4669,11 @@ void FrameView::updateRenderThrottlingStatus(bool hidden,
DCHECK(!m_frame->document() || !m_frame->document()->inStyleRecalc());
bool wasThrottled = canThrottleRendering();
- // Note that we disallow throttling of 0x0 frames because some sites use
- // them to drive UI logic.
- m_hiddenForThrottling = hidden && !frameRect().isEmpty();
+ // Note that we disallow throttling of 0x0 and display:none frames because
+ // some sites use them to drive UI logic.
+ HTMLFrameOwnerElement* ownerElement = m_frame->deprecatedLocalOwner();
+ m_hiddenForThrottling = hidden && !frameRect().isEmpty() &&
+ (ownerElement && ownerElement->layoutObject());
m_subtreeThrottled = subtreeThrottled;
bool isThrottled = canThrottleRendering();
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698