Skip to content

Commit e9071bf

Browse files
committed
update style engine
1 parent 29b8029 commit e9071bf

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

src/wp-includes/style-engine/class-wp-style-engine.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,31 +50,37 @@ final class WP_Style_Engine {
5050
*/
5151
const BLOCK_STYLE_DEFINITIONS_METADATA = array(
5252
'background' => array(
53-
'backgroundImage' => array(
53+
'backgroundImage' => array(
5454
'property_keys' => array(
5555
'default' => 'background-image',
5656
),
5757
'value_func' => array( self::class, 'get_url_or_value_css_declaration' ),
5858
'path' => array( 'background', 'backgroundImage' ),
5959
),
60-
'backgroundPosition' => array(
60+
'backgroundPosition' => array(
6161
'property_keys' => array(
6262
'default' => 'background-position',
6363
),
6464
'path' => array( 'background', 'backgroundPosition' ),
6565
),
66-
'backgroundRepeat' => array(
66+
'backgroundRepeat' => array(
6767
'property_keys' => array(
6868
'default' => 'background-repeat',
6969
),
7070
'path' => array( 'background', 'backgroundRepeat' ),
7171
),
72-
'backgroundSize' => array(
72+
'backgroundSize' => array(
7373
'property_keys' => array(
7474
'default' => 'background-size',
7575
),
7676
'path' => array( 'background', 'backgroundSize' ),
7777
),
78+
'backgroundAttachment' => array(
79+
'property_keys' => array(
80+
'default' => 'background-attachment',
81+
),
82+
'path' => array( 'background', 'backgroundAttachment' ),
83+
),
7884
),
7985
'color' => array(
8086
'text' => array(

tests/phpunit/tests/style-engine/styleEngine.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -539,22 +539,24 @@ public function data_wp_style_engine_get_styles() {
539539
'inline_background_image_url_with_background_size' => array(
540540
'block_styles' => array(
541541
'background' => array(
542-
'backgroundImage' => array(
542+
'backgroundImage' => array(
543543
'url' => 'https://example.com/image.jpg',
544544
),
545-
'backgroundPosition' => 'center',
546-
'backgroundRepeat' => 'no-repeat',
547-
'backgroundSize' => 'cover',
545+
'backgroundPosition' => 'center',
546+
'backgroundRepeat' => 'no-repeat',
547+
'backgroundSize' => 'cover',
548+
'backgroundAttachment' => 'fixed',
548549
),
549550
),
550551
'options' => array(),
551552
'expected_output' => array(
552-
'css' => "background-image:url('https://example.com/image.jpg');background-position:center;background-repeat:no-repeat;background-size:cover;",
553+
'css' => "background-image:url('https://example.com/image.jpg');background-position:center;background-repeat:no-repeat;background-size:cover;background-attachment:fixed;",
553554
'declarations' => array(
554-
'background-image' => "url('https://example.com/image.jpg')",
555-
'background-position' => 'center',
556-
'background-repeat' => 'no-repeat',
557-
'background-size' => 'cover',
555+
'background-image' => "url('https://example.com/image.jpg')",
556+
'background-position' => 'center',
557+
'background-repeat' => 'no-repeat',
558+
'background-size' => 'cover',
559+
'background-attachment' => 'fixed',
558560
),
559561
),
560562
),

0 commit comments

Comments
 (0)