-
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
InOb polyfill trigger new added element w/o tick #8100
Conversation
Hi, ampproject bot here! Here are a list of the owners that can approve your files.
|
this.lastViewportRect_ = null; | ||
|
||
/** @private {./layout-rect.LayoutRectDef|undefined} */ | ||
this.opt_lastIframeRect_ = undefined; |
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.
Instance/class vars cannot have opt_
prefix. Please remove.
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.
removed
LGTM with one request. |
@@ -227,11 +234,22 @@ export class IntersectionObserverPolyfill { | |||
} | |||
} | |||
|
|||
// push new observed element | |||
this.observeEntries_.push({ | |||
const newEntry = { |
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.
as discussed, please avoid overloading the name entry
here. Can be called state
instead.
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.
done
@@ -300,6 +300,7 @@ export class Visibility { | |||
onIntersectionChanges, {threshold: DEFAULT_THRESHOLD}); | |||
//TODO: eventually this is go into the proposed layoutManager. | |||
const viewport = viewportForDoc(this.ampdoc); | |||
this.intersectionObserver_.tick(viewport.getRect()); |
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.
Nit: call ticker
instead of duplicating its code.
* store last tick value * fix type check * remove opt- * rename
fix #7992