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

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

Issue 2389023002: Deferred frame loading stats v2 (Closed)
Patch Set: display:none doesn't work Created 4 years, 2 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 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();

Powered by Google App Engine
This is Rietveld 408576698