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 #23831

Merged
merged 2 commits into from
Aug 9, 2019

Conversation

sebastianbenz
Copy link
Contributor

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

Fixes #17686

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
return;
}
if (this.layout_ === Layout.INTRINSIC) {
const sizerElement = sizer.querySelector('.i-amphtml-intrinsic-sizer');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this not the sizer variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's the nested img element:

<i-amphtml-sizer class="i-amphtml-sizer">
  <img alt="" aria-hidden="true" class="i-amphtml-intrinsic-sizer" role="presentation"     src="data:image/svg+xml;charset=utf-8,<svg height=&quot;100&quot; width=&quot;300&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; version=&quot;1.1&quot;/>">
</i-amphtml-sizer>

@sebastianbenz
Copy link
Contributor Author

@jridgewell can you please merge as well.

@jridgewell jridgewell merged commit 1c42daa into ampproject:master Aug 9, 2019
thekorn pushed a commit to edelight/amphtml that referenced this pull request 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
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make "layout=intrinsic" compatible with SSR and handle resize events
3 participants