Media: Add object-fit to the allowed list of CSS properties.

This resolves a bug in Featured Image blocks where `object-fit` was being removed during the `render_callback`.

Props raduiason, pbiron, kebbet, SergeyBiryukov, bernhard-reiter, ironprogrammer, xknown, audrasjb, ckanderson22, ivanjeronimo, seriouslysenpai, davidbaumwald.
Merges [54675] to the 5.9 branch.
Fixes #56855.



git-svn-id: https://develop.svn.wordpress.org/branches/5.9@54764 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Wilson 2022-11-08 04:35:26 +00:00
parent 007118d6ad
commit 94d0172959
2 changed files with 6 additions and 0 deletions

View File

@ -2415,6 +2415,7 @@ function safecss_filter_attr( $css, $deprecated = '' ) {
'direction',
'float',
'list-style-type',
'object-fit',
'object-position',
'overflow',
'vertical-align',

View File

@ -1093,6 +1093,11 @@ EOF;
'css' => 'background: conic-gradient(at 0% 30%, red 10%, yellow 30%, #1e90ff 50%)',
'expected' => 'background: conic-gradient(at 0% 30%, red 10%, yellow 30%, #1e90ff 50%)',
),
// `object-fit` introduced in 6.1.
array(
'css' => 'object-fit: cover',
'expected' => 'object-fit: cover',
),
// Expressions are not allowed.
array(
'css' => 'height: expression( body.scrollTop + 50 + "px" )',