Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
intersect-resources: Refactor to a lower risk integration (#27497)
* 1vp/3vp observers, make 'force build' less confusing. Add comment about first intersection callback in Chrome 82. Only prerender 1 viewport (if prerenderSize > 0). Create 3vp observer after first 1vp observer callback. Wait until visible to start 3vp observer. First firstCallback. Avoid double-handling by early-out when isIntersecting didn't change. Add comment. Simplify handling of first intersection callback. Tweak comment. Use ampdoc instead of viewer. Add comments. Don't handle prerenderSize_ == 0. Refactor stuff. Less efficient but much more simple. Missing ivar init. Fix types. Remove logs for apply sizes/media query. Remove commented out code. Refactor to use one observer and calculate 1vp. Support 25% larger 'visible rect'. Move log, fix types. Fix missing experiment guard. Add assert in resource.measure, early out if resource was removed. * First pass at pass. * Tidy up a bit. * Fix lint. * Fix case where measure precedes build and resource is never laid out. * Placeholder handling of resource/element build race. * Clean up for PR. * Fix types, add comments. * Revert ignoreQuota in phase 1. * Fix lint for new prettier version. * Fix test-resource.js.
- Loading branch information
William Chou
committed
Apr 2, 2020
1 parent
8393b73
commit d8be2b6
Showing
5 changed files
with
156 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.