reverted: --- b/core/modules/media/css/oembed-frame.css +++ /dev/null @@ -1,10 +0,0 @@ -iframe { - position: absolute; - left: 0; - top: 0; - right: 0; - bottom: 0; - margin: 0; - width: 100%; - height: 100%; -} diff -u b/core/modules/media/media.libraries.yml b/core/modules/media/media.libraries.yml --- b/core/modules/media/media.libraries.yml +++ b/core/modules/media/media.libraries.yml @@ -15,5 +15,11 @@ -oembed_frame: +oembed.formatter: + version VERSION + css: + component: + css/oembed.formatter.css: {} + +oembed.frame: version: VERSION css: component: - css/oembed-frame.css: {} + css/oembed.frame.css: {} diff -u b/core/modules/media/src/Controller/OEmbedIframeController.php b/core/modules/media/src/Controller/OEmbedIframeController.php --- b/core/modules/media/src/Controller/OEmbedIframeController.php +++ b/core/modules/media/src/Controller/OEmbedIframeController.php @@ -164,7 +164,7 @@ '#placeholder_token' => $placeholder_token, ]; if ($scale) { - $element['#attached']['library'][] = 'media/oembed_frame'; + $element['#attached']['library'][] = 'media/oembed.frame'; } $content = $this->renderer->executeInRenderContext(new RenderContext(), function () use ($resource, $element) { return $this->renderer->render($element); diff -u b/core/modules/media/src/Plugin/Field/FieldFormatter/OEmbedFormatter.php b/core/modules/media/src/Plugin/Field/FieldFormatter/OEmbedFormatter.php --- b/core/modules/media/src/Plugin/Field/FieldFormatter/OEmbedFormatter.php +++ b/core/modules/media/src/Plugin/Field/FieldFormatter/OEmbedFormatter.php @@ -223,8 +223,12 @@ 'allowtransparency' => TRUE, 'width' => $max_width ?: $resource->getWidth(), 'height' => $max_height ?: $resource->getHeight(), + 'class' => ['media-oembed-content'], ], ]; + if ($scale) { + $element[$delta]['#attached']['library'][] = 'media/oembed.formatter'; + } CacheableMetadata::createFromObject($resource) ->addCacheTags($this->config->getCacheTags()) reverted: --- b/core/themes/stable/css/media/oembed-frame.css +++ /dev/null @@ -1,10 +0,0 @@ -iframe { - position: absolute; - left: 0; - top: 0; - right: 0; - bottom: 0; - margin: 0; - width: 100%; - height: 100%; -} diff -u b/core/themes/stable/stable.info.yml b/core/themes/stable/stable.info.yml --- b/core/themes/stable/stable.info.yml +++ b/core/themes/stable/stable.info.yml @@ -139,10 +139,14 @@ component: css/locale.admin.css: css/locale/locale.admin.css - media/oembed_frame: + media/oembed.formatter: css: component: - css/oembed-frame.css: css/media/oembed-frame.css + css/oembed.formatter.css: css/media/oembed.formatter.css + media/oembed.frame: + css: + component: + css/oembed.frame.css: css/media/oembed.frame.css menu_ui/drupal.menu_ui.adminforms: css: only in patch2: unchanged: --- /dev/null +++ b/core/modules/media/css/oembed.formatter.css @@ -0,0 +1,3 @@ +.media-oembed-content { + max-width: 100%; +} only in patch2: unchanged: --- /dev/null +++ b/core/modules/media/css/oembed.frame.css @@ -0,0 +1,10 @@ +iframe { + position: absolute; + left: 0; + top: 0; + right: 0; + bottom: 0; + margin: 0; + width: 100%; + height: 100%; +} only in patch2: unchanged: --- /dev/null +++ b/core/themes/stable/css/media/oembed.formatter.css @@ -0,0 +1,3 @@ +.media-oembed-content { + max-width: 100%; +} only in patch2: unchanged: --- /dev/null +++ b/core/themes/stable/css/media/oembed.frame.css @@ -0,0 +1,10 @@ +iframe { + position: absolute; + left: 0; + top: 0; + right: 0; + bottom: 0; + margin: 0; + width: 100%; + height: 100%; +}