-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Visibility trigger for non-amp elements #26995
Conversation
a7c7339
to
11b0bd8
Compare
|
||
// DOM search can "look" outside the boundaries of the root, thus make | ||
// sure the result is contained. Length is not supported in all browsers | ||
if (foundElements && foundElements.length) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not necessary, querySelector
is already guaranteed to contain everything that is returned.
What you're probably thinking of is that querySelector('div img')
can match on <div><root><img/></root></div>
, but this contains check isn't going to fix that. Use scopedQuerySelector
from src/dom.js
11b0bd8
to
75493a7
Compare
Is this PR still active? |
Edit: Will pick up this work after TCFv2 changes, (end of June) |
Just an update: intersection observer experiment is fully launched. Just cleanup is remaining. It can be now used throughout. |
Hey @rsimha! These files were changed:
Hey @erwinmombay! These files were changed:
Hey @jridgewell! These files were changed:
Hey @danielrozenberg! These files were changed:
Hey @alanorozco! These files were changed:
Hey @estherkim! These files were changed:
Hey @wassgha! These files were changed:
Hey @Jiaming-X! These files were changed:
Hey @jeffkaufman! These files were changed:
Hey @gmajoulet! These files were changed:
Hey @processprocess, @t0mg! These files were changed:
Hey @newmuis! These files were changed:
Hey @Enriqe! These files were changed:
Hey @ampproject/wg-caching! These files were changed:
|
To be reviewed/merged after #26823's changes. Guarded with the same feature flag
For #20607
Within the IntersectionObserverPolyfill, if the element is a non-amp element (no getLayoutBox, no owner), asynchronously use
getBoundingClientRect
(offset by thehostViewport
) to find the element's rect.Besides affecting VisibilityManager, this change also impacts RefreshManager (for a4a). Since it manages a4a, we're guaranteed to always get an amp-element so this should not change behavior for it.