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 44f06f71c39688b9e294c312eb2d608559822fb4..4210de45ea123fec1ac9256627f56c2d4eccd135 100644 |
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp |
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp |
@@ -4345,11 +4345,30 @@ void FrameView::updateViewportIntersectionIfNeeded() { |
m_viewportIntersectionValid = true; |
FrameView* parent = parentFrameView(); |
if (!parent) { |
+ // display:none frames have no parent because they're not in the DOM. |
dcheng
2016/10/07 05:52:40
I don't understand this comment in conjunction wit
|
+ if (HTMLFrameOwnerElement* element = frame().deprecatedLocalOwner()) { |
+ if (const ComputedStyle* style = element->computedStyle()) { |
dgrogan
2016/10/05 01:19:08
I'm trying to detect when an iframe has style="dis
dcheng
2016/10/07 05:52:40
I think what's happening here is that there's no L
|
+ if (style->display() == EDisplay::None) |
+ frame().document()->wouldLoadBecause(WouldLoadDisplayNone); |
+ } |
+ } |
+ frame().document()->wouldLoadBecause(WouldLoadOutOfProcess); |
m_viewportIntersection = frameRect(); |
return; |
} |
ASSERT(!parent->m_needsUpdateViewportIntersection); |
+ bool parentLoaded = parent->frame().document()->wouldLoadReason() != Created; |
+ if (parentLoaded) { |
+ if (frameRect().isEmpty()) { |
+ frame().document()->wouldLoadBecause(WouldLoadZeroByZero); |
+ } else if (frameRect().maxY() < 0) { |
+ frame().document()->wouldLoadBecause(WouldLoadAbove); |
+ } else if (frameRect().maxX() < 0) { |
+ frame().document()->wouldLoadBecause(WouldLoadLeft); |
+ } |
+ } |
+ |
// If our parent is hidden, then we are too. |
if (parent->m_viewportIntersection.isEmpty()) { |
m_viewportIntersection = parent->m_viewportIntersection; |
@@ -4368,6 +4387,9 @@ void FrameView::updateViewportIntersectionIfNeeded() { |
// TODO(skyostil): Expand the viewport to make it less likely to see stale content while scrolling. |
IntRect viewport = parent->m_viewportIntersection; |
m_viewportIntersection.intersect(viewport); |
+ |
+ if (parentLoaded && !m_viewportIntersection.isEmpty()) |
+ frame().document()->wouldLoadBecause(WouldLoadVisible); |
} |
void FrameView::updateViewportIntersectionsForSubtree( |
@@ -4453,8 +4475,6 @@ void FrameView::notifyRenderThrottlingObservers() { |
updateThrottlingStatus(); |
- frame().document()->onVisibilityMaybeChanged(!m_hiddenForThrottling); |
- |
bool becameThrottled = !wasThrottled && canThrottleRendering(); |
bool becameUnthrottled = wasThrottled && !canThrottleRendering(); |
ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator(); |