Opened 11 years ago
Closed 11 years ago
#34462 closed enhancement (fixed)
Add a text fallback for the embed iframe
| Reported by: | pento | Owned by: | pento |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.4 |
| Component: | Embeds | Version: | 4.4 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
Suggested by @helen:
I would like to see a text fallback (e.g. a link) provided in the oEmbed response, much like the way Twitter includes a blockquote. I wouldn’t want to see more text from the site, but the title/site name would probably suffice.
This can be included in the oEmbed response data, then hidden when we get a message from the iframe to signal that it loaded correctly.
Attachments (2)
Change History (10)
#2
@
11 years ago
How would that look like when JavaScript is disabled? I guess the iframe needs to be hidden initially. That would work well with #34451 in mind too.
#3
@
11 years ago
Also, the if ( empty( $content[1] ) && empty( $content[2] ) ) check means a <blockquote> is required, right? I don't think it should be. If we use blockquotes, it doesn't mean every other oEmbed provider does as well.
#4
@
11 years ago
in 34462.2.diff:
- Hide the iframe by default (if a blockquote fallback is present), then display it once it sends a message, hiding the blockquote at the same time. This causes a bit less jumping around.
- Require an iframe to be present, instead of previously requiring either a blockquote or an iframe.
- Add some unit tests.
#6
follow-up:
↓ 7
@
11 years ago
- Keywords needs-patch added; has-patch removed
- Resolution fixed
- Status closed → reopened
You'll never receive a postMessage from an iframe that is hidden using display: none.
I'll try to fix this together with #34451.
#7
in reply to: ↑ 6
;
follow-up:
↓ 8
@
11 years ago
Replying to swissspidy:
You'll never receive a postMessage from an iframe that is hidden using
display: none.
Which browser did you test this on? It works fine for me in Chrome, Firefox and Safari.
#8
in reply to: ↑ 7
@
11 years ago
- Keywords needs-patch removed
- Resolution → fixed
- Status reopened → closed
Replying to pento:
Replying to swissspidy:
You'll never receive a postMessage from an iframe that is hidden using
display: none.
Which browser did you test this on? It works fine for me in Chrome, Firefox and Safari.
Chrome. I just tested this again on trunk and couldn't reproduce it, so I guess it was something I introduced myself while working on #34451. So, sorry for acting too hastily.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
34462.diff is a first pass at this.
I don't really like the flash of fallback text that appears before it's hidden, but this is the same behaviour you see with Twitter.