Chromium Code Reviews| 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(); |