Make WordPress Core

Changeset 59199


Ignore:
Timestamp:
10/09/2024 01:26:13 AM (5 months ago)
Author:
andrewserong
Message:

Editor: Fix writingMode support in dynamic blocks.

Adds missing handling for the typography.writingMode property to the style engine, so that dynamic blocks correctly render text orientation styles on the site frontend.

Props wildworks, aaronrobertshaw, poena, get_dave, ndiego.
Fixes #62189.
See #59306.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/style-engine/class-wp-style-engine.php

    r58834 r59199  
    2626 * @since 6.5.0 Added support for background.backgroundPosition,
    2727 *              background.backgroundRepeat and dimensions.aspectRatio.
     28 * @since 6.7.0 Added support for typography.writingMode.
    2829 */
    2930#[AllowDynamicProperties]
     
    305306                ),
    306307                'path'          => array( 'typography', 'letterSpacing' ),
     308            ),
     309            'writingMode'    => array(
     310                'property_keys' => array(
     311                    'default' => 'writing-mode',
     312                ),
     313                'path'          => array( 'typography', 'writingMode' ),
    307314            ),
    308315        ),
  • trunk/tests/phpunit/tests/style-engine/styleEngine.php

    r58834 r59199  
    3030     * @ticket 60175
    3131     * @ticket 61720
     32     * @ticket 62189
    3233     *
    3334     * @covers ::wp_style_engine_get_styles
     
    229230                        'textTransform'  => 'uppercase',
    230231                        'letterSpacing'  => '2',
    231                     ),
    232                 ),
    233                 'options'         => null,
    234                 'expected_output' => array(
    235                     '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;',
     232                        'writingMode'    => 'vertical-rl',
     233                    ),
     234                ),
     235                'options'         => null,
     236                'expected_output' => array(
     237                    '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;',
    236238                    'declarations' => array(
    237239                        'font-size'       => 'clamp(2em, 2vw, 4em)',
     
    244246                        'text-transform'  => 'uppercase',
    245247                        'letter-spacing'  => '2',
     248                        'writing-mode'    => 'vertical-rl',
    246249                    ),
    247250                ),
Note: See TracChangeset for help on using the changeset viewer.