Opened 6 years ago
Closed 6 years ago
#48482 closed defect (bug) (fixed)
Block library applying width of 100% to iframe
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 5.3 | Priority: | normal |
| Severity: | normal | Version: | 5.3 |
| Component: | Editor | Keywords: | |
| Focuses: | Cc: |
Description
In 5.3, there's some styling at wp-includes/css/dist/block-library/style.css that sets the width for iframe elements to 100%. You can see it here:
It looks like this may result from this commit to Gutenberg:
Should this be set to max-width? The width: 100% setting can cause issues with existing iframes (ad units, for example).
Change History (6)
#2
@
6 years ago
Created https://github.com/WordPress/gutenberg/pull/18240 to explore a fix for this.
#4
@
6 years ago
I've been looking into this, and the issue of an extra iframe { width: 100%; } affects iframes which are supposed to have it's width set via HTML width attribute. Eg.:
<iframe width="560" height="315" src="https://videopress.com/embed/bd2G0c0g" frameborder="0" allowfullscreen></iframe>
In my tests, the width="560" gets ignored if there is a iframe { width: 100%; } in the stylesheets - eg.: introduced by the block editor as in the case mentioned in this ticket.
To me it feels like this change might affect installs using various advertisement systems ( eg: Google ads ... ), as well as sharing video content via iframes ( eg: YouTube, WordPress.tv ... ).
#5
@
6 years ago
There's a patch in https://github.com/WordPress/gutenberg/pull/18240 as well, that I've requested a review for. Hopefully it can land soon.
#6
@
6 years ago
- Milestone changed from Awaiting Review to 5.3
- Resolution set to fixed
- Status changed from new to closed
Hi there, welcome to WordPress Trac! Thanks for the ticket.
It looks like a fix for this was merged upstream in https://github.com/WordPress/gutenberg/pull/18287 and made it into core in [46656].
cc @joen for input as I believe you authored the original Gutenberg commit referred to above.