From 8eb5431bf74dd28ae9a5b5260942a463e75744f9 Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Tue, 8 Oct 2024 12:28:56 +1100 Subject: [PATCH 1/3] Add writingMode to the style engine, to support dynamic blocks --- src/wp-includes/style-engine/class-wp-style-engine.php | 6 ++++++ tests/phpunit/tests/style-engine/styleEngine.php | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/style-engine/class-wp-style-engine.php b/src/wp-includes/style-engine/class-wp-style-engine.php index 3012ca3eefd30..20ee499bba1fa 100644 --- a/src/wp-includes/style-engine/class-wp-style-engine.php +++ b/src/wp-includes/style-engine/class-wp-style-engine.php @@ -305,6 +305,12 @@ final class WP_Style_Engine { ), 'path' => array( 'typography', 'letterSpacing' ), ), + 'writingMode' => array( + 'property_keys' => array( + 'default' => 'writing-mode', + ), + 'path' => array( 'typography', 'writingMode' ), + ), ), ); diff --git a/tests/phpunit/tests/style-engine/styleEngine.php b/tests/phpunit/tests/style-engine/styleEngine.php index 686865c6803ab..021232bdf4fef 100644 --- a/tests/phpunit/tests/style-engine/styleEngine.php +++ b/tests/phpunit/tests/style-engine/styleEngine.php @@ -29,6 +29,7 @@ public function tear_down() { * @ticket 58590 * @ticket 60175 * @ticket 61720 + * @ticket 62189 * * @covers ::wp_style_engine_get_styles * @@ -228,11 +229,12 @@ public function data_wp_style_engine_get_styles() { 'textDecoration' => 'underline', 'textTransform' => 'uppercase', 'letterSpacing' => '2', + 'writingMode' => 'vertical-rl', ), ), 'options' => null, 'expected_output' => array( - 'css' => 'font-size:clamp(2em, 2vw, 4em);font-family:Roboto,Oxygen-Sans,Ubuntu,sans-serif;font-style:italic;font-weight:800;line-height:1.3;column-count:2;text-decoration:underline;text-transform:uppercase;letter-spacing:2;', + 'css' => 'font-size:clamp(2em, 2vw, 4em);font-family:Roboto,Oxygen-Sans,Ubuntu,sans-serif;font-style:italic;font-weight:800;line-height:1.3;column-count:2;text-decoration:underline;text-transform:uppercase;letter-spacing:2;writing-mode:vertical-rl;', 'declarations' => array( 'font-size' => 'clamp(2em, 2vw, 4em)', 'font-family' => 'Roboto,Oxygen-Sans,Ubuntu,sans-serif', @@ -243,6 +245,7 @@ public function data_wp_style_engine_get_styles() { 'text-decoration' => 'underline', 'text-transform' => 'uppercase', 'letter-spacing' => '2', + 'writing-mode' => 'vertical-rl', ), ), ), From 95e5667a01707f23602296deed332633ff0b5d5e Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Tue, 8 Oct 2024 14:37:58 +1100 Subject: [PATCH 2/3] Empty commit to trigger rebuild From aac2bee2c1a8ca8999dd52294859654db6981624 Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Wed, 9 Oct 2024 10:31:56 +1100 Subject: [PATCH 3/3] Update since annotation --- src/wp-includes/style-engine/class-wp-style-engine.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wp-includes/style-engine/class-wp-style-engine.php b/src/wp-includes/style-engine/class-wp-style-engine.php index 20ee499bba1fa..5582aacbb1db9 100644 --- a/src/wp-includes/style-engine/class-wp-style-engine.php +++ b/src/wp-includes/style-engine/class-wp-style-engine.php @@ -25,6 +25,7 @@ * @since 6.4.0 Added support for background.backgroundImage. * @since 6.5.0 Added support for background.backgroundPosition, * background.backgroundRepeat and dimensions.aspectRatio. + * @since 6.7.0 Added support for typography.writingMode. */ #[AllowDynamicProperties] final class WP_Style_Engine {