<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[57493] trunk: Editor: Add `viewStyle` property to `block.json` for frontend-only block styles</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/57493">57493</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/57493","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>gziolo</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2024-01-31 09:09:22 +0000 (Wed, 31 Jan 2024)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Editor: Add `viewStyle` property to `block.json` for frontend-only block styles

Related issue in Gutenberg: https://github.com/WordPress/gutenberg/issues/54491.

For block scripts there was already `script`, `viewScript` and `editorScript`. For block styles there was only `style` and `editorStyle`. This brings the parity.

Props gaambo.
Fixes <a href="https://core.trac.wordpress.org/ticket/59673">#59673</a>. </pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesblocksphp">trunk/src/wp-includes/blocks.php</a></li>
<li><a href="#trunksrcwpincludesclasswpblocktypephp">trunk/src/wp-includes/class-wp-block-type.php</a></li>
<li><a href="#trunksrcwpincludesclasswpblockphp">trunk/src/wp-includes/class-wp-block.php</a></li>
<li><a href="#trunksrcwpincludesrestapiendpointsclasswprestblocktypescontrollerphp">trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php</a></li>
<li><a href="#trunktestsphpunitdatablocksnoticeblockjson">trunk/tests/phpunit/data/blocks/notice/block.json</a></li>
<li><a href="#trunktestsphpunittestsblocksregisterphp">trunk/tests/phpunit/tests/blocks/register.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestblocktypecontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-block-type-controller.php</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunktestsphpunitdatablocksnoticeblockviewcss">trunk/tests/phpunit/data/blocks/notice/block-view.css</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesblocksphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/blocks.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/blocks.php  2024-01-31 08:29:18 UTC (rev 57492)
+++ trunk/src/wp-includes/blocks.php    2024-01-31 09:09:22 UTC (rev 57493)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -64,6 +64,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                'viewScript'   => 'view-script',
</span><span class="cx" style="display: block; padding: 0 10px">                'editorStyle'  => 'editor-style',
</span><span class="cx" style="display: block; padding: 0 10px">                'style'        => 'style',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                'viewStyle'    => 'view-style',
</ins><span class="cx" style="display: block; padding: 0 10px">         );
</span><span class="cx" style="display: block; padding: 0 10px">        $asset_handle   = str_replace( '/', '-', $block_name ) .
</span><span class="cx" style="display: block; padding: 0 10px">                '-' . $field_mappings[ $field_name ];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -326,6 +327,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * @since 6.1.0 Added support for `render` field.
</span><span class="cx" style="display: block; padding: 0 10px">  * @since 6.3.0 Added `selectors` field.
</span><span class="cx" style="display: block; padding: 0 10px">  * @since 6.4.0 Added support for `blockHooks` field.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 6.5.0 Added support for `viewStyle` field.
</ins><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * @param string $file_or_folder Path to the JSON file with metadata definition for
</span><span class="cx" style="display: block; padding: 0 10px">  *                               the block or path to the folder where the `block.json` file is located.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -503,6 +505,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        $style_fields = array(
</span><span class="cx" style="display: block; padding: 0 10px">                'editorStyle' => 'editor_style_handles',
</span><span class="cx" style="display: block; padding: 0 10px">                'style'       => 'style_handles',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                'viewStyle'   => 'view_style_handles',
</ins><span class="cx" style="display: block; padding: 0 10px">         );
</span><span class="cx" style="display: block; padding: 0 10px">        foreach ( $style_fields as $metadata_field_name => $settings_field_name ) {
</span><span class="cx" style="display: block; padding: 0 10px">                if ( ! empty( $settings[ $metadata_field_name ] ) ) {
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpblocktypephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-block-type.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-block-type.php     2024-01-31 08:29:18 UTC (rev 57492)
+++ trunk/src/wp-includes/class-wp-block-type.php       2024-01-31 09:09:22 UTC (rev 57493)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -235,6 +235,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public $style_handles = array();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         * Block type front end only style handles.
+        *
+        * @since 6.5.0
+        * @var string[]
+        */
+       public $view_style_handles = array();
+
+       /**
</ins><span class="cx" style="display: block; padding: 0 10px">          * Deprecated block type properties for script and style handles.
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @since 6.1.0
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -278,6 +286,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         *              Deprecated the `editor_script`, `script`, `view_script`, `editor_style`, and `style` properties.
</span><span class="cx" style="display: block; padding: 0 10px">         * @since 6.3.0 Added the `selectors` property.
</span><span class="cx" style="display: block; padding: 0 10px">         * @since 6.4.0 Added the `block_hooks` property.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         * @since 6.5.0 Added the `view_style_handles` property.
</ins><span class="cx" style="display: block; padding: 0 10px">          *
</span><span class="cx" style="display: block; padding: 0 10px">         * @see register_block_type()
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -315,6 +324,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         *     @type string[]      $view_script_handles      Block type front end only script handles.
</span><span class="cx" style="display: block; padding: 0 10px">         *     @type string[]      $editor_style_handles     Block type editor only style handles.
</span><span class="cx" style="display: block; padding: 0 10px">         *     @type string[]      $style_handles            Block type front end and editor style handles.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         *     @type string[]      $view_style_handles       Block type front end only style handles.
</ins><span class="cx" style="display: block; padding: 0 10px">          * }
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function __construct( $block_type, $args = array() ) {
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpblockphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-block.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-block.php  2024-01-31 08:29:18 UTC (rev 57492)
+++ trunk/src/wp-includes/class-wp-block.php    2024-01-31 09:09:22 UTC (rev 57493)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -280,6 +280,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                if ( ( ! empty( $this->block_type->view_style_handles ) ) ) {
+                       foreach ( $this->block_type->view_style_handles as $view_style_handle ) {
+                               wp_enqueue_style( $view_style_handle );
+                       }
+               }
+
</ins><span class="cx" style="display: block; padding: 0 10px">                 /**
</span><span class="cx" style="display: block; padding: 0 10px">                 * Filters the content of a single block.
</span><span class="cx" style="display: block; padding: 0 10px">                 *
</span></span></pre></div>
<a id="trunksrcwpincludesrestapiendpointsclasswprestblocktypescontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php 2024-01-31 08:29:18 UTC (rev 57492)
+++ trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php   2024-01-31 09:09:22 UTC (rev 57493)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -292,6 +292,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'view_script_handles',
</span><span class="cx" style="display: block; padding: 0 10px">                                'editor_style_handles',
</span><span class="cx" style="display: block; padding: 0 10px">                                'style_handles',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                'view_style_handles',
</ins><span class="cx" style="display: block; padding: 0 10px">                                 'variations',
</span><span class="cx" style="display: block; padding: 0 10px">                                'block_hooks',
</span><span class="cx" style="display: block; padding: 0 10px">                        ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -602,6 +603,16 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                        'context'     => array( 'embed', 'view', 'edit' ),
</span><span class="cx" style="display: block; padding: 0 10px">                                        'readonly'    => true,
</span><span class="cx" style="display: block; padding: 0 10px">                                ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                'view_style_handles'    => array(
+                                       'description' => __( 'Public facing style handles.' ),
+                                       'type'        => array( 'array' ),
+                                       'default'     => array(),
+                                       'items'       => array(
+                                               'type' => 'string',
+                                       ),
+                                       'context'     => array( 'embed', 'view', 'edit' ),
+                                       'readonly'    => true,
+                               ),
</ins><span class="cx" style="display: block; padding: 0 10px">                                 'styles'                => array(
</span><span class="cx" style="display: block; padding: 0 10px">                                        'description' => __( 'Block style variations.' ),
</span><span class="cx" style="display: block; padding: 0 10px">                                        'type'        => 'array',
</span></span></pre></div>
<a id="trunktestsphpunitdatablocksnoticeblockviewcss"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/tests/phpunit/data/blocks/notice/block-view.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/notice/block-view.css                             (rev 0)
+++ trunk/tests/phpunit/data/blocks/notice/block-view.css       2024-01-31 09:09:22 UTC (rev 57493)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/* Test front end only CSS file */
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/tests/phpunit/data/blocks/notice/block-view.css
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunktestsphpunitdatablocksnoticeblockjson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/data/blocks/notice/block.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/notice/block.json 2024-01-31 08:29:18 UTC (rev 57492)
+++ trunk/tests/phpunit/data/blocks/notice/block.json   2024-01-31 09:09:22 UTC (rev 57493)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -70,5 +70,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">        "viewScript": [ "tests-notice-view-script", "tests-notice-view-script-2" ],
</span><span class="cx" style="display: block; padding: 0 10px">        "editorStyle": "tests-notice-editor-style",
</span><span class="cx" style="display: block; padding: 0 10px">        "style": [ "tests-notice-style", "tests-notice-style-2" ],
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        "viewStyle": [ "tests-notice-view-style" ],
</ins><span class="cx" style="display: block; padding: 0 10px">         "render": "file:./render.php"
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsblocksregisterphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/blocks/register.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/blocks/register.php     2024-01-31 08:29:18 UTC (rev 57492)
+++ trunk/tests/phpunit/tests/blocks/register.php       2024-01-31 09:09:22 UTC (rev 57493)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -156,6 +156,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'unit-tests-my-block-style',
</span><span class="cx" style="display: block; padding: 0 10px">                        generate_block_asset_handle( $block_name, 'style' )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                // @ticket 59673
+               $this->assertSame(
+                       'unit-tests-my-block-view-style',
+                       generate_block_asset_handle( $block_name, 'viewStyle' ),
+                       'asset handle for viewStyle is not generated correctly'
+               );
</ins><span class="cx" style="display: block; padding: 0 10px">         }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -439,9 +445,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_success_register_block_style_handle() {
</span><span class="cx" style="display: block; padding: 0 10px">                $metadata = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        'file'  => DIR_TESTDATA . '/blocks/notice/block.json',
-                       'name'  => 'unit-tests/test-block',
-                       'style' => 'file:./block.css',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 'file'      => DIR_TESTDATA . '/blocks/notice/block.json',
+                       'name'      => 'unit-tests/test-block',
+                       'style'     => 'file:./block.css',
+                       'viewStyle' => 'file:./block-view.css',
</ins><span class="cx" style="display: block; padding: 0 10px">                 );
</span><span class="cx" style="display: block; padding: 0 10px">                $result   = register_block_style_handle( $metadata, 'style' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -454,6 +461,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        wp_normalize_path( wp_styles()->get_data( 'unit-tests-test-block-style', 'path' ) )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                // Test viewStyle property
+               $result = register_block_style_handle( $metadata, 'viewStyle' );
+               $this->assertSame( 'unit-tests-test-block-view-style', $result );
+
+               // @ticket 59673
+               $this->assertSame(
+                       wp_normalize_path( realpath( DIR_TESTDATA . '/blocks/notice/block-view.css' ) ),
+                       wp_normalize_path( wp_styles()->get_data( 'unit-tests-test-block-view-style', 'path' ) ),
+                       'viewStyle asset path is not correct'
+               );
+
</ins><span class="cx" style="display: block; padding: 0 10px">                 // Test the behavior directly within the unit test
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertFalse(
</span><span class="cx" style="display: block; padding: 0 10px">                        strpos(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -837,6 +855,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        array( 'tests-notice-style', 'tests-notice-style-2' ),
</span><span class="cx" style="display: block; padding: 0 10px">                        $result->style_handles
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                // @ticket 59673
+               $this->assertSameSets(
+                       array( 'tests-notice-view-style' ),
+                       $result->view_style_handles,
+                       'parsed view_style_handles is not correct'
+               );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // @ticket 50328
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertSame(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -844,6 +868,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        wp_normalize_path( wp_styles()->get_data( 'unit-tests-test-block-style', 'path' ) )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                // @ticket 59673
+               $this->assertSame(
+                       wp_normalize_path( realpath( DIR_TESTDATA . '/blocks/notice/block-view.css' ) ),
+                       wp_normalize_path( wp_styles()->get_data( 'unit-tests-test-block-view-style', 'path' ) ),
+                       'viewStyle asset path is not correct'
+               );
+
</ins><span class="cx" style="display: block; padding: 0 10px">                 // @ticket 53148
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertIsCallable( $result->render_callback );
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestblocktypecontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/rest-api/rest-block-type-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-block-type-controller.php 2024-01-31 08:29:18 UTC (rev 57492)
+++ trunk/tests/phpunit/tests/rest-api/rest-block-type-controller.php   2024-01-31 09:09:22 UTC (rev 57493)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -557,7 +557,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $response   = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">                $data       = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">                $properties = $data['schema']['properties'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->assertCount( 30, $properties );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $this->assertCount( 31, $properties );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $this->assertArrayHasKey( 'api_version', $properties );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertArrayHasKey( 'name', $properties );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertArrayHasKey( 'title', $properties );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -582,6 +582,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertArrayHasKey( 'view_script_handles', $properties );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertArrayHasKey( 'editor_style_handles', $properties );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertArrayHasKey( 'style_handles', $properties );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                $this->assertArrayHasKey( 'view_style_handles', $properties, 'schema must contain view_style_handles' );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $this->assertArrayHasKey( 'is_dynamic', $properties );
</span><span class="cx" style="display: block; padding: 0 10px">                // Deprecated properties.
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertArrayHasKey( 'editor_script', $properties );
</span></span></pre>
</div>
</div>

</body>
</html>