-
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
Owned resources may render to left or right of viewport #5583
Conversation
This allows owned resources to render when outside the viewport on the x-axis (only). This works because owned resources will never be prerendered until the owner explicitly allows it. So, the owner knows better than Resources does at this point. Fixes ampproject#5549.
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 looks great. Could you please also add a test? (I'm approving right away since I'm online spotingly).
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.
+1 on what Dima said.
For reference, this was introduced in #4081. Working on tests. |
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.
Maybe don't #5549 yet though, Carousel still needs to honor renderOutsideViewport
value instead of just preloading +/- 1.
Also why should we get this far at all when an owner explicitly says prerender this child? Should that not skip all the visibility checks anyway?
Carousel knows better than Resources does. Resources intentionally skips anything owned when doing it's own preloading. So any of Carousel's slides won't be preloaded by Resources. But Carousel only tries to preload the next (or previous) slide, so no issue with trusting the preload call when the are owned. |
@jridgewell The owner check can't just be on the horizontal case though. If a vertical element (e.g. say sidebar) takes ownership of its children and calls |
@aghassemi This is a temporary fix. We can't yet manage the composite elements properly. |
@zhouyx Could we merge this into canary? |
👌 |
) * Owned resources may render to left or right of viewport This allows owned resources to render when outside the viewport on the x-axis (only). This works because owned resources will never be prerendered until the owner explicitly allows it. So, the owner knows better than Resources does at this point. Fixes ampproject#5549. * Add tests
) * Owned resources may render to left or right of viewport This allows owned resources to render when outside the viewport on the x-axis (only). This works because owned resources will never be prerendered until the owner explicitly allows it. So, the owner knows better than Resources does at this point. Fixes ampproject#5549. * Add tests
This allows owned resources to render when outside the viewport on the
x-axis (only). This works because owned resources will never be
prerendered until the owner explicitly allows it. So, the owner knows
better than Resources does at this point.
Fixes #5549.