New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 635105 link

Starred by 11 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Chrome , Mac , Fuchsia
Pri: 3
Type: Bug

Blocking:
issue 701884
issue 709494



Sign in to add a comment

Defer cross-origin iframe loads until they are viewable

Project Member Reported by dgro...@chromium.org, Aug 5 2016

Issue description

Rephrased from https://github.com/WICG/interventions/issues/10:

Deferring the load of out-of-view iframes might improve the loading experience, granting more bandwidth and cpu to things on the screen already.
 
Labels: Hotlist-Interventions
Project Member

Comment 5 by bugdroid1@chromium.org, Oct 20 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2723d5de8d9244cb0065a85f4fc0430a637868e8

commit 2723d5de8d9244cb0065a85f4fc0430a637868e8
Author: mathp <mathp@chromium.org>
Date: Thu Oct 20 13:02:50 2016

Revert "Log to UMA why we would load a third-party frame"

This reverts commit 89406fe9ba00bb4b543d3bb89da3d4682539a065.

Causing test failures in Deferred Loading

https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Win%20x64%20Builder%20%28dbg%29/builds/96387

Original review: https://codereview.chromium.org/2389023002/

BUG= 635105 
TBR=isherman,dcheng
NOTRY=true

Review-Url: https://chromiumcodereview.appspot.com/2432933005
Cr-Commit-Position: refs/heads/master@{#426462}

[modify] https://crrev.com/2723d5de8d9244cb0065a85f4fc0430a637868e8/third_party/WebKit/Source/core/dom/Document.cpp
[modify] https://crrev.com/2723d5de8d9244cb0065a85f4fc0430a637868e8/third_party/WebKit/Source/core/dom/Document.h
[modify] https://crrev.com/2723d5de8d9244cb0065a85f4fc0430a637868e8/third_party/WebKit/Source/core/frame/FrameView.cpp
[modify] https://crrev.com/2723d5de8d9244cb0065a85f4fc0430a637868e8/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
[modify] https://crrev.com/2723d5de8d9244cb0065a85f4fc0430a637868e8/third_party/WebKit/Source/web/BUILD.gn
[delete] https://crrev.com/f1064efe79837bd304344cc1125ec8ec8c7ff898/third_party/WebKit/Source/web/tests/DeferredLoadingTest.cpp
[modify] https://crrev.com/2723d5de8d9244cb0065a85f4fc0430a637868e8/tools/metrics/histograms/histograms.xml

Project Member

Comment 6 by bugdroid1@chromium.org, Oct 22 2016

Labels: Merge-Request-55
I want to merge the change in comment 6 (c301da12f702e16e64faf04524f89bde02ad9588) to 55. It only collects data; no behavior change.

Comment 8 by dimu@chromium.org, Oct 24 2016

Labels: -Merge-Request-55 Merge-Approved-55 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M55 (branch: 2883)
Project Member

Comment 9 by bugdroid1@chromium.org, Oct 24 2016

Labels: -merge-approved-55 merge-merged-2883
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5ca7d242d3f11698547c96b3c2aacd8b5b0171ea

commit 5ca7d242d3f11698547c96b3c2aacd8b5b0171ea
Author: David Grogan <dgrogan@chromium.org>
Date: Mon Oct 24 18:34:43 2016

Log to UMA why we would load a third-party frame

This will give an estimate of the % of iframes that we can defer
loading.

We can defer offscreen frames unless they are probably used for
cross-origin communication.

Reland of https://codereview.chromium.org/2389023002

BUG= 635105 
TBR=isherman@chromium.org

Review-Url: https://chromiumcodereview.appspot.com/2437193002
Cr-Commit-Position: refs/heads/master@{#426979}
(cherry picked from commit c301da12f702e16e64faf04524f89bde02ad9588)

Review URL: https://codereview.chromium.org/2449473003 .

Cr-Commit-Position: refs/branch-heads/2883@{#244}
Cr-Branched-From: 614d31daee2f61b0180df403a8ad43f20b9f6dd7-refs/heads/master@{#423768}

[modify] https://crrev.com/5ca7d242d3f11698547c96b3c2aacd8b5b0171ea/third_party/WebKit/Source/core/dom/Document.cpp
[modify] https://crrev.com/5ca7d242d3f11698547c96b3c2aacd8b5b0171ea/third_party/WebKit/Source/core/dom/Document.h
[modify] https://crrev.com/5ca7d242d3f11698547c96b3c2aacd8b5b0171ea/third_party/WebKit/Source/core/frame/FrameView.cpp
[modify] https://crrev.com/5ca7d242d3f11698547c96b3c2aacd8b5b0171ea/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
[modify] https://crrev.com/5ca7d242d3f11698547c96b3c2aacd8b5b0171ea/third_party/WebKit/Source/web/BUILD.gn
[add] https://crrev.com/5ca7d242d3f11698547c96b3c2aacd8b5b0171ea/third_party/WebKit/Source/web/tests/DeferredLoadingTest.cpp
[modify] https://crrev.com/5ca7d242d3f11698547c96b3c2aacd8b5b0171ea/tools/metrics/histograms/histograms.xml

Drive-by: I wonder how much win we will get if we just issue iframe loads (and loads from iframes) with IDLE priority? They will always be bumped to the bottom of the network queue, and we might avoid cases where deferring the load forever will break the web.

Obviously it won't give us all the benefits (blocking the load forever means it will never run JS, for instance). Still, it might be interesting to try as an experiment group? Does anyone know if we've tried this already?
sorry, to be clear: we would reprioritize away from IDLE when the frames come into view.
Project Member

Comment 12 by bugdroid1@chromium.org, Oct 27 2016

Labels: merge-merged-2840
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5ca7d242d3f11698547c96b3c2aacd8b5b0171ea

commit 5ca7d242d3f11698547c96b3c2aacd8b5b0171ea
Author: David Grogan <dgrogan@chromium.org>
Date: Mon Oct 24 18:34:43 2016

Log to UMA why we would load a third-party frame

This will give an estimate of the % of iframes that we can defer
loading.

We can defer offscreen frames unless they are probably used for
cross-origin communication.

Reland of https://codereview.chromium.org/2389023002

BUG= 635105 
TBR=isherman@chromium.org

Review-Url: https://chromiumcodereview.appspot.com/2437193002
Cr-Commit-Position: refs/heads/master@{#426979}
(cherry picked from commit c301da12f702e16e64faf04524f89bde02ad9588)

Review URL: https://codereview.chromium.org/2449473003 .

Cr-Commit-Position: refs/branch-heads/2883@{#244}
Cr-Branched-From: 614d31daee2f61b0180df403a8ad43f20b9f6dd7-refs/heads/master@{#423768}

[modify] https://crrev.com/5ca7d242d3f11698547c96b3c2aacd8b5b0171ea/third_party/WebKit/Source/core/dom/Document.cpp
[modify] https://crrev.com/5ca7d242d3f11698547c96b3c2aacd8b5b0171ea/third_party/WebKit/Source/core/dom/Document.h
[modify] https://crrev.com/5ca7d242d3f11698547c96b3c2aacd8b5b0171ea/third_party/WebKit/Source/core/frame/FrameView.cpp
[modify] https://crrev.com/5ca7d242d3f11698547c96b3c2aacd8b5b0171ea/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
[modify] https://crrev.com/5ca7d242d3f11698547c96b3c2aacd8b5b0171ea/third_party/WebKit/Source/web/BUILD.gn
[add] https://crrev.com/5ca7d242d3f11698547c96b3c2aacd8b5b0171ea/third_party/WebKit/Source/web/tests/DeferredLoadingTest.cpp
[modify] https://crrev.com/5ca7d242d3f11698547c96b3c2aacd8b5b0171ea/tools/metrics/histograms/histograms.xml

Project Member

Comment 13 by bugdroid1@chromium.org, Oct 28 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e10fbfce772e735f8b5fbedb94a67bff8e8f8e91

commit e10fbfce772e735f8b5fbedb94a67bff8e8f8e91
Author: dgrogan <dgrogan@chromium.org>
Date: Fri Oct 28 04:06:02 2016

Third-party iframe logging: Separate out AboveAndLeft from Above

Early data shows that iframes above the page, which includes iframes
that are simultaneously above AND left of the page, are 25x more common
than iframes only to the left of the page. It's possible that
AboveAndLeft are most common, which could explain the discrepancy.

BUG= 635105 

Review-Url: https://codereview.chromium.org/2450293003
Cr-Commit-Position: refs/heads/master@{#428278}

[modify] https://crrev.com/e10fbfce772e735f8b5fbedb94a67bff8e8f8e91/third_party/WebKit/Source/core/dom/Document.cpp
[modify] https://crrev.com/e10fbfce772e735f8b5fbedb94a67bff8e8f8e91/third_party/WebKit/Source/core/dom/Document.h
[modify] https://crrev.com/e10fbfce772e735f8b5fbedb94a67bff8e8f8e91/third_party/WebKit/Source/core/frame/FrameView.cpp
[modify] https://crrev.com/e10fbfce772e735f8b5fbedb94a67bff8e8f8e91/third_party/WebKit/Source/web/tests/DeferredLoadingTest.cpp
[modify] https://crrev.com/e10fbfce772e735f8b5fbedb94a67bff8e8f8e91/tools/metrics/histograms/histograms.xml

Comment 14 by dimu@google.com, Nov 4 2016

Labels: -merge-merged-2840
[Automated comment] removing mislabelled merge-merged-2840
csharrison -- I don't think anyone has tried that idea. I recorded it in a Deferred Frame Loading doc that I'm going to pass around once we have more data.
Project Member

Comment 16 by bugdroid1@chromium.org, Mar 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/86dfe7dc82290cede82086ad6e42ecaf54af4376

commit 86dfe7dc82290cede82086ad6e42ecaf54af4376
Author: dgrogan <dgrogan@chromium.org>
Date: Wed Mar 01 04:01:06 2017

Cross-origin iframes: collect data under hypothetical loading strategies

Log % of frames to never load if we only loaded those that are
- visible, or
- 1 screen below
- 2 screens below
- 3 screens below

We would load frames used for cross-origin talk in any of the scenarios.

Note that we only look below for frames we might have to preload and ignore
frames to the right, assuming that the vast majority of content is
consumed vertically.

Also note that logging to one bucket will also log to each lower bucket,
which makes sense: if a frame has to be loaded under the "1 screen"
scenario, it would have to be loaded under a "3 screen" scenario.

This data will inform discussion of what our policy might eventually be.

BUG= 635105 

Review-Url: https://codereview.chromium.org/2516473002
Cr-Commit-Position: refs/heads/master@{#453837}

[modify] https://crrev.com/86dfe7dc82290cede82086ad6e42ecaf54af4376/third_party/WebKit/Source/core/dom/Document.cpp
[modify] https://crrev.com/86dfe7dc82290cede82086ad6e42ecaf54af4376/third_party/WebKit/Source/core/dom/Document.h
[modify] https://crrev.com/86dfe7dc82290cede82086ad6e42ecaf54af4376/third_party/WebKit/Source/core/frame/FrameView.cpp
[modify] https://crrev.com/86dfe7dc82290cede82086ad6e42ecaf54af4376/third_party/WebKit/Source/core/frame/FrameView.h
[modify] https://crrev.com/86dfe7dc82290cede82086ad6e42ecaf54af4376/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
[modify] https://crrev.com/86dfe7dc82290cede82086ad6e42ecaf54af4376/third_party/WebKit/Source/web/tests/DeferredLoadingTest.cpp
[modify] https://crrev.com/86dfe7dc82290cede82086ad6e42ecaf54af4376/tools/metrics/histograms/histograms.xml

Cc: darin@chromium.org deanm@chromium.org
 Issue 19906  has been merged into this issue.
Cc: -deanm@chromium.org dgro...@chromium.org
Labels: -OS-All OS-Android OS-Chrome OS-Fuchsia OS-Linux OS-Mac
Owner: sclit...@chromium.org
Components: Blink>Loader>LazyLoad
Project Member

Comment 20 by bugdroid1@chromium.org, Apr 12 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ff6a053e80180657468530f037ef045848671c4b

commit ff6a053e80180657468530f037ef045848671c4b
Author: Scott Little <sclittle@chromium.org>
Date: Thu Apr 12 19:44:50 2018

Add basic support for lazily loading below the fold cross-origin iframes

This CL adds basic support (behind a flag) for deferring the load of
cross-origin frames until the user scrolls near them, in order to reduce
network data usage, memory usage, and speed up the loading of other
content on the page.

When a frame is deferred, an IntersectionObserver is used to detect when
the deferred frame element is within a specific distance threshold of
the viewport and resume loading the frame. Currently, this
distance-from-viewport threshold is hardcoded, but in future CLs it will
be supplied from a field trial parameter.

Heuristics (i.e. tiny dimensions or offscreen position) are used to
recognize and immediately load frames that are likely used for analytics
or inter-frame communication, since those kinds of frames would be
broken by deferring them.

Once a lazily-loaded frame starts loading in, children within that
lazily-loaded frame won't be lazily loaded themselves. This will make it
possible for subresources in hidden frames to load that will never be
visible, as well as make it so that deferred frames that have multiple
layers of iframes inside them can load faster once they're near the
viewport or visible.

See the design docs below for more info.

LazyFrames design doc:
https://docs.google.com/document/d/1ITh7UqhmfirprVtjEtpfhga5Qyfoh78UkRmW8r3CntM/edit

LazyLoad design doc:
https://docs.google.com/document/d/1e8ZbVyUwgIkQMvJma3kKUDg8UUkLRRdANStqKuOIvHg/edit

Bug:  635105 
Change-Id: I970221f527861298b58ed5b4662eb04019bc86ff
Reviewed-on: https://chromium-review.googlesource.com/979256
Commit-Queue: Scott Little <sclittle@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550317}
[modify] https://crrev.com/ff6a053e80180657468530f037ef045848671c4b/content/child/runtime_features.cc
[modify] https://crrev.com/ff6a053e80180657468530f037ef045848671c4b/content/public/common/content_features.cc
[modify] https://crrev.com/ff6a053e80180657468530f037ef045848671c4b/content/public/common/content_features.h
[modify] https://crrev.com/ff6a053e80180657468530f037ef045848671c4b/third_party/blink/public/platform/web_runtime_features.h
[modify] https://crrev.com/ff6a053e80180657468530f037ef045848671c4b/third_party/blink/renderer/core/BUILD.gn
[modify] https://crrev.com/ff6a053e80180657468530f037ef045848671c4b/third_party/blink/renderer/core/frame/frame_owner.h
[modify] https://crrev.com/ff6a053e80180657468530f037ef045848671c4b/third_party/blink/renderer/core/frame/remote_frame_owner.cc
[modify] https://crrev.com/ff6a053e80180657468530f037ef045848671c4b/third_party/blink/renderer/core/frame/remote_frame_owner.h
[modify] https://crrev.com/ff6a053e80180657468530f037ef045848671c4b/third_party/blink/renderer/core/html/html_frame_owner_element.cc
[modify] https://crrev.com/ff6a053e80180657468530f037ef045848671c4b/third_party/blink/renderer/core/html/html_frame_owner_element.h
[add] https://crrev.com/ff6a053e80180657468530f037ef045848671c4b/third_party/blink/renderer/core/html/html_frame_owner_element_test.cc
[modify] https://crrev.com/ff6a053e80180657468530f037ef045848671c4b/third_party/blink/renderer/core/loader/frame_loader.cc
[modify] https://crrev.com/ff6a053e80180657468530f037ef045848671c4b/third_party/blink/renderer/platform/exported/web_runtime_features.cc
[modify] https://crrev.com/ff6a053e80180657468530f037ef045848671c4b/third_party/blink/renderer/platform/runtime_enabled_features.json5

Project Member

Comment 22 by bugdroid1@chromium.org, Apr 17 2018

Labels: merge-merged-testbranch
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ff6a053e80180657468530f037ef045848671c4b

commit ff6a053e80180657468530f037ef045848671c4b
Author: Scott Little <sclittle@chromium.org>
Date: Thu Apr 12 19:44:50 2018

Add basic support for lazily loading below the fold cross-origin iframes

This CL adds basic support (behind a flag) for deferring the load of
cross-origin frames until the user scrolls near them, in order to reduce
network data usage, memory usage, and speed up the loading of other
content on the page.

When a frame is deferred, an IntersectionObserver is used to detect when
the deferred frame element is within a specific distance threshold of
the viewport and resume loading the frame. Currently, this
distance-from-viewport threshold is hardcoded, but in future CLs it will
be supplied from a field trial parameter.

Heuristics (i.e. tiny dimensions or offscreen position) are used to
recognize and immediately load frames that are likely used for analytics
or inter-frame communication, since those kinds of frames would be
broken by deferring them.

Once a lazily-loaded frame starts loading in, children within that
lazily-loaded frame won't be lazily loaded themselves. This will make it
possible for subresources in hidden frames to load that will never be
visible, as well as make it so that deferred frames that have multiple
layers of iframes inside them can load faster once they're near the
viewport or visible.

See the design docs below for more info.

LazyFrames design doc:
https://docs.google.com/document/d/1ITh7UqhmfirprVtjEtpfhga5Qyfoh78UkRmW8r3CntM/edit

LazyLoad design doc:
https://docs.google.com/document/d/1e8ZbVyUwgIkQMvJma3kKUDg8UUkLRRdANStqKuOIvHg/edit

Bug:  635105 
Change-Id: I970221f527861298b58ed5b4662eb04019bc86ff
Reviewed-on: https://chromium-review.googlesource.com/979256
Commit-Queue: Scott Little <sclittle@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550317}
[modify] https://crrev.com/ff6a053e80180657468530f037ef045848671c4b/content/child/runtime_features.cc
[modify] https://crrev.com/ff6a053e80180657468530f037ef045848671c4b/content/public/common/content_features.cc
[modify] https://crrev.com/ff6a053e80180657468530f037ef045848671c4b/content/public/common/content_features.h
[modify] https://crrev.com/ff6a053e80180657468530f037ef045848671c4b/third_party/blink/public/platform/web_runtime_features.h
[modify] https://crrev.com/ff6a053e80180657468530f037ef045848671c4b/third_party/blink/renderer/core/BUILD.gn
[modify] https://crrev.com/ff6a053e80180657468530f037ef045848671c4b/third_party/blink/renderer/core/frame/frame_owner.h
[modify] https://crrev.com/ff6a053e80180657468530f037ef045848671c4b/third_party/blink/renderer/core/frame/remote_frame_owner.cc
[modify] https://crrev.com/ff6a053e80180657468530f037ef045848671c4b/third_party/blink/renderer/core/frame/remote_frame_owner.h
[modify] https://crrev.com/ff6a053e80180657468530f037ef045848671c4b/third_party/blink/renderer/core/html/html_frame_owner_element.cc
[modify] https://crrev.com/ff6a053e80180657468530f037ef045848671c4b/third_party/blink/renderer/core/html/html_frame_owner_element.h
[add] https://crrev.com/ff6a053e80180657468530f037ef045848671c4b/third_party/blink/renderer/core/html/html_frame_owner_element_test.cc
[modify] https://crrev.com/ff6a053e80180657468530f037ef045848671c4b/third_party/blink/renderer/core/loader/frame_loader.cc
[modify] https://crrev.com/ff6a053e80180657468530f037ef045848671c4b/third_party/blink/renderer/platform/exported/web_runtime_features.cc
[modify] https://crrev.com/ff6a053e80180657468530f037ef045848671c4b/third_party/blink/renderer/platform/runtime_enabled_features.json5

Status: Fixed (was: Started)
Blocking: 701884
Blocking: 709494

Sign in to add a comment