Skip to content
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

🍱 [amp-iframe:1.0] Bento tracking issue #35147

Closed
6 tasks done
dmanek opened this issue Jul 7, 2021 · 4 comments
Closed
6 tasks done

🍱 [amp-iframe:1.0] Bento tracking issue #35147

dmanek opened this issue Jul 7, 2021 · 4 comments
Assignees

Comments

@dmanek
Copy link
Contributor

dmanek commented Jul 7, 2021

High-Level Requirements

To be updated as information becomes available.

Consideration Ready When Status
Component Compatibility Conformance with 0.1 ✖️
Testing Unit tests and pre-existing e2e tests pass ✖️
Internationalization n/a
Analytics n/a
Accessibility Audit performed ✖️
Page Experience Audit performed ✖️
Documentation Written ✖️
Storybook Samples written in Preact and AMP ✖️

Feature Checklist

To be updated as information becomes available.

Migration Notes

To be updated as information becomes available.

Open Tasks

  • Initial implementation
  • iframe with placeholder
  • iframe position (600px away or beyond first 75% of viewport)
  • resizing at runtime
  • viewability (send-intersections message)
  • validation rules

Notifications

/cc @ampproject/wg-bento

@kristoferbaxter
Copy link
Contributor

What's the fundamental difference between this implementation and using loading=lazy on a traditional iframe?

@dmanek
Copy link
Contributor Author

dmanek commented Jul 12, 2021

@kristoferbaxter There are a few differences in the way AMP treats iframes vs traditional iframes with loading=lazy:

  1. AMP enforces iframes outside of the top 75% or 600px whichever is smaller. It enforces a placeholder when this condition is not met. With traditional iframes, we cannot guarantee that.
  2. loading=lazy is only supported in Chromium based browsers as of now (https://caniuse.com/loading-lazy-attr). Also the thresholds to lazy load resources may differ among browsers (Chrome for example takes into account connection type, whether Lite mode is enabled, etc.)

That said, I've briefly thought about supporting loading=lazy but need to dig further as to how it many affect amp-iframe's current positioning restrictions and behavior for browser that do not support it yet.

@kristoferbaxter
Copy link
Contributor

AMP enforces iframes outside of the top 75% or 600px whichever is smaller. It enforces a placeholder when this condition is not met. With traditional iframes, we cannot guarantee that.

Is this enforcement via client-side JS? If so, could it be reasonably implemented on top of a native iframe element and avoid the custom element creation?

loading=lazy is only supported in Chromium based browsers as of now (https://caniuse.com/loading-lazy-attr). Also the thresholds to lazy load resources may differ among browsers (Chrome for example takes into account connection type, whether Lite mode is enabled, etc.)

I had forgotten about this browser support issue, and this may reasonably be a reason to use a custom implementation from within a Viewer environment. Is there a path to making the native implementation valid, and ensuring it doesn't break when loaded from within a Viewer?

@dmanek
Copy link
Contributor Author

dmanek commented Oct 7, 2021

'send-consent-data' feature is tracked in #36211.

@dmanek dmanek closed this as completed Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants