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

Restrict width of oEmbeds to max possible width of iframe #1876

Closed
wants to merge 1 commit into from

Conversation

westonruter
Copy link
Member

@westonruter westonruter commented Jul 12, 2017

The max width of a sandbox iframe containing embeds is 608px. Nevertheless, the oEmbeds being fetched for the iframe are getting the default width of 660px. The result is:

image

Note that even with this fix applied, no effect will be noticed because there is also a bug in core that prevents the maxwidth param from being passed along to the oEmbed provider. For the fix, which I think will be part of 4.8.1, see https://github.com/xwp/wordpress-develop/pull/239.

Also, it feels not right to hard-code the width of 608 especially since the block editing UI is responsive. It would seem preferable to use the offsetWidth of the containing element instead to compute this dynamically. Advise on how to best to get this width and to pass it along in the request would be appreciated.

Closely related to making videos responsive: #1658.

@westonruter westonruter added the [Status] In Progress Tracking issues with work in progress label Jul 12, 2017
@aduth
Copy link
Member

aduth commented Aug 3, 2017

Can this be resolved with a max-width or width style (100%) applied to the frame?

@youknowriad youknowriad added the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Jan 29, 2018
@gziolo gziolo removed the [Status] In Progress Tracking issues with work in progress label Feb 5, 2018
@danielbachhuber
Copy link
Member

@westonruter Any suggestions on how you'd like to move this forward? Even if you use offsetWidth in the initial request, that's still a static value if the user resizes their browser window.

Does it make sense to close this pull request and open an issue?

@westonruter
Copy link
Member Author

I don't have any other suggestions.

@westonruter westonruter closed this Apr 2, 2018
@gziolo gziolo deleted the fix/embed-sandbox-width branch May 7, 2018 11:14
Tug pushed a commit that referenced this pull request Feb 28, 2020
…from-web

Update page templates feature flag name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants