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

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

Issue 2660633002: 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 20f073c65f2843de195fb4bc8dcecab6d2d9e568..a0d27c975a50c86f6a5402efcf74b193c12b1f2f 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -4603,6 +4603,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);
+ DCHECK(!canThrottleRendering());
+ }
+
for (Frame* child = m_frame->tree().firstChild(); child;
child = child->tree().nextSibling()) {
if (!child->isLocalFrame())
@@ -4623,9 +4630,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