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

Make "layout=intrinsic" compatible with SSR and handle resize events #17686

Closed
jpettitt opened this issue Aug 23, 2018 · 4 comments · Fixed by #23831
Closed

Make "layout=intrinsic" compatible with SSR and handle resize events #17686

jpettitt opened this issue Aug 23, 2018 · 4 comments · Fixed by #23831

Comments

@jpettitt
Copy link
Contributor

Need to update https://github.com/ampproject/amphtml/blob/master/src/custom-element.js#L613-L617 to handle SSR'd elements with instrinsic layout.

Need to ensure that resize events correctly update the sizing scaling SVG at
https://github.com/ampproject/amphtml/blob/master/src/custom-element.js#L691

@jpettitt
Copy link
Contributor Author

jpettitt commented Aug 23, 2018

@aghassemi I may be able to take this depending on other workload and what the timing of SSR for layout=intrinsic is.

cc @honeybadgerdontcare @jridgewell

@ampprojectbot
Copy link
Member

This issue hasn't been updated in awhile. @aghassemi Do you have any updates?

@aghassemi aghassemi removed their assignment Jun 19, 2019
@dreamofabear dreamofabear changed the title Make "layout=instrinsic" compatible with SSR and handle resize events. Make "layout=intrinsic" compatible with SSR and handle resize events Jun 25, 2019
@sebastianbenz
Copy link
Contributor

I've started looking into this for AMP Optimizer (and to unblock SSR for WP). What's the problem with resize events?

Need to ensure that resize events correctly update the sizing scaling SVG at
https://github.com/ampproject/amphtml/blob/master/src/custom-element.js#L691

@jridgewell
Copy link
Contributor

He's talking about

setStyle(sizer, 'paddingTop', '0');
. It needs to be set on the sizer in case the element's size changes before we initialize the custom element.

sebastianbenz added a commit to sebastianbenz/amphtml that referenced this issue Aug 8, 2019
Handles resize events by setting intrinsic layout's img src to ''. This
does not include validator updates to support the intrinsic sizer.

Fixes ampproject#17686
sebastianbenz added a commit to sebastianbenz/amphtml that referenced this issue Aug 8, 2019
Handles resize events by setting intrinsic layout's img src to ''. This
does not include validator updates to support the intrinsic sizer.

Fixes ampproject#17686
jridgewell pushed a commit that referenced this issue Aug 9, 2019
* Make "layout=intrinsic" compatible with SSR

Handles resize events by setting intrinsic layout's img src to ''. This
does not include validator updates to support the intrinsic sizer.

Fixes #17686

* change variable name
thekorn pushed a commit to edelight/amphtml that referenced this issue Sep 11, 2019
* Make "layout=intrinsic" compatible with SSR

Handles resize events by setting intrinsic layout's img src to ''. This
does not include validator updates to support the intrinsic sizer.

Fixes ampproject#17686

* change variable name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants