Pass iframe dimensions through if supplied
What does this MR do and why?
Per #282443 ("What Could Still Be Implemented"), let's apply the width/height attributes to embedded frames the same way we do images.
I've also extracted the spec fixtures into a separate file for cleanliness' sake.
References
Past work:
- Add Banzai filter for detecting potential `ifra... (!204952 - merged) was the preliminary work for potential iframe recognition
- Allow iframe embeds in markdown from allowed sr... (!200864 - merged) carried the initial implementation
- Push iframe feature flag to frontend based on p... (!215529 - merged) fixed two bugs that stopped it from being usable on GitLab.com; since this MR the feature is configured and usable on GitLab.com, but you need to enable the FF for your group (we have it enabled in groupknowledge)
Present work: a series of 4 stacked MRs for %18.10 to bring this closer to GA:
- Pass iframe dimensions through if supplied (!224624 - merged) — You are here
- Avoid iframes having to deal with asset proxy/l... (!224625 - merged)
- Treat `<iframe>` as `<img>` (!224626 - merged)
- Transform `<iframe>` URLs according to a registry (!223870 - merged)
Screenshots or screen recordings
How to set up and validate locally
- Check out the branch.
- Enable the
allow_iframes_in_markdownfeature on your GDK. - Enable embedding of
www.youtube.comfrom/admin/application_settings/general#js-iframe-settings, and ensureEnable embedded contentis turned on. - It may be wise to restart the GDK Rails instance here, for best chances of success.
- Using the plain-text editor, insert content like seen in the screenshot above to a wiki page, issue description, MR comment, etc.:
Here's my YouTube video at default size:  Here it is with a reasonable size applied: {width=800 height=600} - It should look as it does in the screenshot above. (The status quo is that both embeds would be the same size as the first.)
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Asherah Connor
