Make WordPress Core


Ignore:
Timestamp:
01/09/2024 06:10:09 AM (17 months ago)
Author:
isabel_brison
Message:

Editor: add size and repeat to background image support.

Adds background size and background repeat style processing to the background image block support and WP_Style_Engine definitions.

Props andrewserong, mukesh27.
Fixes #60175.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/style-engine/styleEngine.php

    r57253 r57254  
    2828     * @ticket 58549
    2929     * @ticket 58590
     30     * @ticket 60175
    3031     *
    3132     * @covers ::wp_style_engine_get_styles
     
    521522                'block_styles'    => array(
    522523                    'background' => array(
    523                         'backgroundImage' => array(
     524                        'backgroundImage'    => array(
    524525                            'url' => 'https://example.com/image.jpg',
    525526                        ),
    526                         'backgroundSize'  => 'cover',
    527                     ),
    528                 ),
    529                 'options'         => array(),
    530                 'expected_output' => array(
    531                     'css'          => "background-image:url('https://example.com/image.jpg');background-size:cover;",
    532                     'declarations' => array(
    533                         'background-image' => "url('https://example.com/image.jpg')",
    534                         'background-size'  => 'cover',
     527                        'backgroundPosition' => 'center',
     528                        'backgroundRepeat'   => 'no-repeat',
     529                        'backgroundSize'     => 'cover',
     530                    ),
     531                ),
     532                'options'         => array(),
     533                'expected_output' => array(
     534                    'css'          => "background-image:url('https://example.com/image.jpg');background-position:center;background-repeat:no-repeat;background-size:cover;",
     535                    'declarations' => array(
     536                        'background-image'    => "url('https://example.com/image.jpg')",
     537                        'background-position' => 'center',
     538                        'background-repeat'   => 'no-repeat',
     539                        'background-size'     => 'cover',
    535540                    ),
    536541                ),
Note: See TracChangeset for help on using the changeset viewer.