Embeds: Use a more accessible way to initially hide the iframe.

This fixes a bug in Firefox where assets inside the iframe aren't being displayed because they have no computed style.

See #35894.

git-svn-id: https://develop.svn.wordpress.org/trunk@36708 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Pascal Birchler
2016-02-25 10:22:43 +00:00
parent eaaef09d83
commit a57b5c8ce5
3 changed files with 5 additions and 5 deletions

View File

@@ -83,14 +83,14 @@ EOD;
$html = '<blockquote></blockquote><iframe></iframe>';
$actual = wp_filter_oembed_result( $html, (object) array( 'type' => 'rich' ), '' );
$this->assertEquals( '<blockquote class="wp-embedded-content"></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="display:none;"></iframe>', $actual );
$this->assertEquals( '<blockquote class="wp-embedded-content"></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="position: absolute; clip: rect(1px, 1px, 1px, 1px);"></iframe>', $actual );
}
function test_filter_oembed_result_allowed_html() {
$html = '<blockquote class="foo" id="bar"><strong><a href="" target=""></a></strong></blockquote><iframe></iframe>';
$actual = wp_filter_oembed_result( $html, (object) array( 'type' => 'rich' ), '' );
$this->assertEquals( '<blockquote class="wp-embedded-content"><a href=""></a></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="display:none;"></iframe>', $actual );
$this->assertEquals( '<blockquote class="wp-embedded-content"><a href=""></a></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="position: absolute; clip: rect(1px, 1px, 1px, 1px);"></iframe>', $actual );
}
/**