<!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>[56179] trunk/src/wp-includes: Docs: Replace multiple single line comments with multi-line comments.</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/56179">56179</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/56179","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>audrasjb</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2023-07-09 21:38:35 +0000 (Sun, 09 Jul 2023)</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'>Docs: Replace multiple single line comments with multi-line comments.

This changeset updates various comments as per WordPress PHP Inline Documentation Standards.
See https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/<a href="https://core.trac.wordpress.org/ticket/5">#5</a>-inline-comments.

Follow-up to <a href="https://core.trac.wordpress.org/changeset/56174">[56174]</a>, <a href="https://core.trac.wordpress.org/changeset/56175">[56175]</a>, <a href="https://core.trac.wordpress.org/changeset/56176">[56176]</a>, <a href="https://core.trac.wordpress.org/changeset/56177">[56177]</a>, <a href="https://core.trac.wordpress.org/changeset/56178">[56178]</a>.

Props costdev, audrasjb.
See <a href="https://core.trac.wordpress.org/ticket/58459">#58459</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesclasswpthemejsonresolverphp">trunk/src/wp-includes/class-wp-theme-json-resolver.php</a></li>
<li><a href="#trunksrcwpincludesclasswpthemejsonphp">trunk/src/wp-includes/class-wp-theme-json.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesclasswpthemejsonresolverphp"></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-theme-json-resolver.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-theme-json-resolver.php    2023-07-09 21:23:34 UTC (rev 56178)
+++ trunk/src/wp-includes/class-wp-theme-json-resolver.php      2023-07-09 21:38:35 UTC (rev 56179)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -358,8 +358,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                isset( $block_type->supports['spacing']['blockGap']['__experimentalDefault'] ) &&
</span><span class="cx" style="display: block; padding: 0 10px">                                null === _wp_array_get( $config, array( 'styles', 'blocks', $block_name, 'spacing', 'blockGap' ), null )
</span><span class="cx" style="display: block; padding: 0 10px">                        ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                // Ensure an empty placeholder value exists for the block, if it provides a default blockGap value.
-                               // The real blockGap value to be used will be determined when the styles are rendered for output.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         /*
+                                * Ensure an empty placeholder value exists for the block, if it provides a default blockGap value.
+                                * The real blockGap value to be used will be determined when the styles are rendered for output.
+                                */
</ins><span class="cx" style="display: block; padding: 0 10px">                                 $config['styles']['blocks'][ $block_name ]['spacing']['blockGap'] = null;
</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">@@ -512,8 +514,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                return new WP_Theme_JSON( $config, 'custom' );
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        // Very important to verify that the flag isGlobalStylesUserThemeJSON is true.
-                       // If it's not true then the content was not escaped and is not safe.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 /*
+                        * Very important to verify that the flag isGlobalStylesUserThemeJSON is true.
+                        * If it's not true then the content was not escaped and is not safe.
+                        */
</ins><span class="cx" style="display: block; padding: 0 10px">                         if (
</span><span class="cx" style="display: block; padding: 0 10px">                                is_array( $decoded_data ) &&
</span><span class="cx" style="display: block; padding: 0 10px">                                isset( $decoded_data['isGlobalStylesUserThemeJSON'] ) &&
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpthemejsonphp"></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-theme-json.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-theme-json.php     2023-07-09 21:23:34 UTC (rev 56178)
+++ trunk/src/wp-includes/class-wp-theme-json.php       2023-07-09 21:38:35 UTC (rev 56179)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -545,8 +545,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public static function get_element_class_name( $element ) {
</span><span class="cx" style="display: block; padding: 0 10px">                $class_name = '';
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                // TODO: Replace array_key_exists() with isset() check once WordPress drops
-               // support for PHP 5.6. See https://core.trac.wordpress.org/ticket/57067.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         /*
+                * TODO: Replace array_key_exists() with isset() check once WordPress drops
+                * support for PHP 5.6. See https://core.trac.wordpress.org/ticket/57067.
+                */
</ins><span class="cx" style="display: block; padding: 0 10px">                 if ( array_key_exists( $element, static::__EXPERIMENTAL_ELEMENT_CLASS_NAMES ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        $class_name = static::__EXPERIMENTAL_ELEMENT_CLASS_NAMES[ $element ];
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -671,8 +673,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        protected static function do_opt_in_into_settings( &$context ) {
</span><span class="cx" style="display: block; padding: 0 10px">                foreach ( static::APPEARANCE_TOOLS_OPT_INS as $path ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        // Use "unset prop" as a marker instead of "null" because
-                       // "null" can be a valid value for some props (e.g. blockGap).
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 /*
+                        * Use "unset prop" as a marker instead of "null" because
+                        * "null" can be a valid value for some props (e.g. blockGap).
+                        */
</ins><span class="cx" style="display: block; padding: 0 10px">                         if ( 'unset prop' === _wp_array_get( $context, $path, 'unset prop' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                _wp_array_set( $context, $path, true );
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -736,8 +740,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">                foreach ( $valid_element_names as $element ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        $schema_styles_elements[ $element ] = $styles_non_top_level;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        // TODO: Replace array_key_exists() with isset() check once WordPress drops
-                       // support for PHP 5.6. See https://core.trac.wordpress.org/ticket/57067.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 /*
+                        * TODO: Replace array_key_exists() with isset() check once WordPress drops
+                        * support for PHP 5.6. See https://core.trac.wordpress.org/ticket/57067.
+                        */
</ins><span class="cx" style="display: block; padding: 0 10px">                         if ( array_key_exists( $element, static::VALID_ELEMENT_PSEUDO_SELECTORS ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                foreach ( static::VALID_ELEMENT_PSEUDO_SELECTORS[ $element ] as $pseudo_selector ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                        $schema_styles_elements[ $element ][ $pseudo_selector ] = $styles_non_top_level;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1083,8 +1089,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( ! empty( $options['root_selector'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                $root_selector = $options['root_selector'];
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        // Base layout styles are provided as part of `styles`, so only output separately if explicitly requested.
-                       // For backwards compatibility, the Columns block is explicitly included, to support a different default gap value.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 /*
+                        * Base layout styles are provided as part of `styles`, so only output separately if explicitly requested.
+                        * For backwards compatibility, the Columns block is explicitly included, to support a different default gap value.
+                        */
</ins><span class="cx" style="display: block; padding: 0 10px">                         $base_styles_nodes = array(
</span><span class="cx" style="display: block; padding: 0 10px">                                array(
</span><span class="cx" style="display: block; padding: 0 10px">                                        'path'     => array( 'styles' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1275,8 +1283,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $layout_definitions       = wp_get_layout_definitions();
</span><span class="cx" style="display: block; padding: 0 10px">                $layout_selector_pattern  = '/^[a-zA-Z0-9\-\.\ *+>:\(\)]*$/'; // Allow alphanumeric classnames, spaces, wildcard, sibling, child combinator and pseudo class selectors.
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                // Gap styles will only be output if the theme has block gap support, or supports a fallback gap.
-               // Default layout gap styles will be skipped for themes that do not explicitly opt-in to blockGap with a `true` or `false` value.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         /*
+                * Gap styles will only be output if the theme has block gap support, or supports a fallback gap.
+                * Default layout gap styles will be skipped for themes that do not explicitly opt-in to blockGap with a `true` or `false` value.
+                */
</ins><span class="cx" style="display: block; padding: 0 10px">                 if ( $has_block_gap_support || $has_fallback_gap_support ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        $block_gap_value = null;
</span><span class="cx" style="display: block; padding: 0 10px">                        // Use a fallback gap value if block gap support is not available.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1554,8 +1564,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        protected static function compute_preset_classes( $settings, $selector, $origins ) {
</span><span class="cx" style="display: block; padding: 0 10px">                if ( static::ROOT_BLOCK_SELECTOR === $selector ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        // Classes at the global level do not need any CSS prefixed,
-                       // and we don't want to increase its specificity.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 /*
+                        * Classes at the global level do not need any CSS prefixed,
+                        * and we don't want to increase its specificity.
+                        */
</ins><span class="cx" style="display: block; padding: 0 10px">                         $selector = '';
</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">@@ -1897,8 +1909,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( str_starts_with( $css_property, '--wp--style--root--' ) && ( static::ROOT_BLOCK_SELECTOR !== $selector || ! $use_root_padding ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                continue;
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        // Root-level padding styles don't currently support strings with CSS shorthand values.
-                       // This may change: https://github.com/WordPress/gutenberg/issues/40132.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 /*
+                        * Root-level padding styles don't currently support strings with CSS shorthand values.
+                        * This may change: https://github.com/WordPress/gutenberg/issues/40132.
+                        */
</ins><span class="cx" style="display: block; padding: 0 10px">                         if ( '--wp--style--root--padding' === $css_property && is_string( $value ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                continue;
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1907,13 +1921,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                $root_variable_duplicates[] = substr( $css_property, strlen( '--wp--style--root--' ) );
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        // Look up protected properties, keyed by value path.
-                       // Skip protected properties that are explicitly set to `null`.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 /*
+                        * Look up protected properties, keyed by value path.
+                        * Skip protected properties that are explicitly set to `null`.
+                        */
</ins><span class="cx" style="display: block; padding: 0 10px">                         if ( is_array( $value_path ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                $path_string = implode( '.', $value_path );
</span><span class="cx" style="display: block; padding: 0 10px">                                if (
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        // TODO: Replace array_key_exists() with isset() check once WordPress drops
-                                       // support for PHP 5.6. See https://core.trac.wordpress.org/ticket/57067.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 /*
+                                        * TODO: Replace array_key_exists() with isset() check once WordPress drops
+                                        * support for PHP 5.6. See https://core.trac.wordpress.org/ticket/57067.
+                                        */
</ins><span class="cx" style="display: block; padding: 0 10px">                                         array_key_exists( $path_string, static::PROTECTED_PROPERTIES ) &&
</span><span class="cx" style="display: block; padding: 0 10px">                                        _wp_array_get( $settings, static::PROTECTED_PROPERTIES[ $path_string ], null ) === null
</span><span class="cx" style="display: block; padding: 0 10px">                                ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2118,9 +2136,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                        'selector' => static::ELEMENTS[ $element ],
</span><span class="cx" style="display: block; padding: 0 10px">                                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                // Handle any pseudo selectors for the element.
-                               // TODO: Replace array_key_exists() with isset() check once WordPress drops
-                               // support for PHP 5.6. See https://core.trac.wordpress.org/ticket/57067.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         /*
+                                * Handle any pseudo selectors for the element.
+                                * TODO: Replace array_key_exists() with isset() check once WordPress drops
+                                * support for PHP 5.6. See https://core.trac.wordpress.org/ticket/57067.
+                                */
</ins><span class="cx" style="display: block; padding: 0 10px">                                 if ( array_key_exists( $element, static::VALID_ELEMENT_PSEUDO_SELECTORS ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                        foreach ( static::VALID_ELEMENT_PSEUDO_SELECTORS[ $element ] as $pseudo_selector ) {
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2270,9 +2290,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                                'selector' => $selectors[ $name ]['elements'][ $element ],
</span><span class="cx" style="display: block; padding: 0 10px">                                        );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        // Handle any pseudo selectors for the element.
-                                       // TODO: Replace array_key_exists() with isset() check once WordPress drops
-                                       // support for PHP 5.6. See https://core.trac.wordpress.org/ticket/57067.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 /*
+                                        * Handle any pseudo selectors for the element.
+                                        * TODO: Replace array_key_exists() with isset() check once WordPress drops
+                                        * support for PHP 5.6. See https://core.trac.wordpress.org/ticket/57067.
+                                        */
</ins><span class="cx" style="display: block; padding: 0 10px">                                         if ( array_key_exists( $element, static::VALID_ELEMENT_PSEUDO_SELECTORS ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                                foreach ( static::VALID_ELEMENT_PSEUDO_SELECTORS[ $element ] as $pseudo_selector ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                                        if ( isset( $theme_json['styles']['blocks'][ $name ]['elements'][ $element ][ $pseudo_selector ] ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2351,8 +2373,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $element_pseudo_allowed = array();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                // TODO: Replace array_key_exists() with isset() check once WordPress drops
-               // support for PHP 5.6. See https://core.trac.wordpress.org/ticket/57067.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         /*
+                * TODO: Replace array_key_exists() with isset() check once WordPress drops
+                * support for PHP 5.6. See https://core.trac.wordpress.org/ticket/57067.
+                */
</ins><span class="cx" style="display: block; padding: 0 10px">                 if ( array_key_exists( $current_element, static::VALID_ELEMENT_PSEUDO_SELECTORS ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        $element_pseudo_allowed = static::VALID_ELEMENT_PSEUDO_SELECTORS[ $current_element ];
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2378,8 +2402,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">                 * Otherwise just compute the styles for the default selector as normal.
</span><span class="cx" style="display: block; padding: 0 10px">                 */
</span><span class="cx" style="display: block; padding: 0 10px">                if ( $pseudo_selector && isset( $node[ $pseudo_selector ] ) &&
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        // TODO: Replace array_key_exists() with isset() check once WordPress drops
-                       // support for PHP 5.6. See https://core.trac.wordpress.org/ticket/57067.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 /*
+                        * TODO: Replace array_key_exists() with isset() check once WordPress drops
+                        * support for PHP 5.6. See https://core.trac.wordpress.org/ticket/57067.
+                        */
</ins><span class="cx" style="display: block; padding: 0 10px">                         array_key_exists( $current_element, static::VALID_ELEMENT_PSEUDO_SELECTORS )
</span><span class="cx" style="display: block; padding: 0 10px">                        && in_array( $pseudo_selector, static::VALID_ELEMENT_PSEUDO_SELECTORS[ $current_element ], true )
</span><span class="cx" style="display: block; padding: 0 10px">                ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2869,9 +2895,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        /*
</span><span class="cx" style="display: block; padding: 0 10px">                         * $output is stripped of pseudo selectors. Re-add and process them
</span><span class="cx" style="display: block; padding: 0 10px">                         * or insecure styles here.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         *
+                        * TODO: Replace array_key_exists() with isset() check once WordPress drops
+                        * support for PHP 5.6. See https://core.trac.wordpress.org/ticket/57067.
</ins><span class="cx" style="display: block; padding: 0 10px">                          */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        // TODO: Replace array_key_exists() with isset() check once WordPress drops
-                       // support for PHP 5.6. See https://core.trac.wordpress.org/ticket/57067.
</del><span class="cx" style="display: block; padding: 0 10px">                         if ( array_key_exists( $current_element, static::VALID_ELEMENT_PSEUDO_SELECTORS ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                foreach ( static::VALID_ELEMENT_PSEUDO_SELECTORS[ $current_element ] as $pseudo_selector ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                        if ( isset( $input[ $pseudo_selector ] ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2992,8 +3019,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( static::is_safe_css_declaration( $declaration['name'], $declaration['value'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                $path = static::PROPERTIES_METADATA[ $declaration['name'] ];
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                // Check the value isn't an array before adding so as to not
-                               // double up shorthand and longhand styles.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         /*
+                                * Check the value isn't an array before adding so as to not
+                                * double up shorthand and longhand styles.
+                                */
</ins><span class="cx" style="display: block; padding: 0 10px">                                 $value = _wp_array_get( $input, $path, array() );
</span><span class="cx" style="display: block; padding: 0 10px">                                if ( ! is_array( $value ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                        _wp_array_set( $output, $path, $value );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3236,8 +3265,10 @@
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                // If all of the static::APPEARANCE_TOOLS_OPT_INS are true,
-               // this code unsets them and sets 'appearanceTools' instead.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         /*
+                * If all of the static::APPEARANCE_TOOLS_OPT_INS are true,
+                * this code unsets them and sets 'appearanceTools' instead.
+                */
</ins><span class="cx" style="display: block; padding: 0 10px">                 foreach ( $nodes as $node ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        $all_opt_ins_are_set = true;
</span><span class="cx" style="display: block; padding: 0 10px">                        foreach ( static::APPEARANCE_TOOLS_OPT_INS as $opt_in_path ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3245,8 +3276,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                foreach ( $opt_in_path as $opt_in_path_item ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                        $full_path[] = $opt_in_path_item;
</span><span class="cx" style="display: block; padding: 0 10px">                                }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                // Use "unset prop" as a marker instead of "null" because
-                               // "null" can be a valid value for some props (e.g. blockGap).
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         /*
+                                * Use "unset prop" as a marker instead of "null" because
+                                * "null" can be a valid value for some props (e.g. blockGap).
+                                */
</ins><span class="cx" style="display: block; padding: 0 10px">                                 $opt_in_value = _wp_array_get( $output, $full_path, 'unset prop' );
</span><span class="cx" style="display: block; padding: 0 10px">                                if ( 'unset prop' === $opt_in_value ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                        $all_opt_ins_are_set = false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3263,18 +3296,22 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                        foreach ( $opt_in_path as $opt_in_path_item ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                                $full_path[] = $opt_in_path_item;
</span><span class="cx" style="display: block; padding: 0 10px">                                        }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        // Use "unset prop" as a marker instead of "null" because
-                                       // "null" can be a valid value for some props (e.g. blockGap).
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 /*
+                                        * Use "unset prop" as a marker instead of "null" because
+                                        * "null" can be a valid value for some props (e.g. blockGap).
+                                        */
</ins><span class="cx" style="display: block; padding: 0 10px">                                         $opt_in_value = _wp_array_get( $output, $full_path, 'unset prop' );
</span><span class="cx" style="display: block; padding: 0 10px">                                        if ( true !== $opt_in_value ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                                continue;
</span><span class="cx" style="display: block; padding: 0 10px">                                        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        // The following could be improved to be path independent.
-                                       // At the moment it relies on a couple of assumptions:
-                                       //
-                                       // - all opt-ins having a path of size 2.
-                                       // - there's two sources of settings: the top-level and the block-level.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 /*
+                                        * The following could be improved to be path independent.
+                                        * At the moment it relies on a couple of assumptions:
+                                        *
+                                        * - all opt-ins having a path of size 2.
+                                        * - there's two sources of settings: the top-level and the block-level.
+                                        */
</ins><span class="cx" style="display: block; padding: 0 10px">                                         if (
</span><span class="cx" style="display: block; padding: 0 10px">                                                ( 1 === count( $node['path'] ) ) &&
</span><span class="cx" style="display: block; padding: 0 10px">                                                ( 'settings' === $node['path'][0] )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3510,12 +3547,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @return array The block's element selectors.
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        protected static function get_block_element_selectors( $root_selector ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                // Assign defaults, then override those that the block sets by itself.
-               // If the block selector is compounded, will append the element to each
-               // individual block selector.
-               $block_selectors   = explode( ',', $root_selector );
-               $element_selectors = array();
-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         /*
+                * Assign defaults, then override those that the block sets by itself.
+                * If the block selector is compounded, will append the element to each
+                * individual block selector.
+                * $block_selectors   = explode( ',', $root_selector );
+                * $element_selectors = array();
+                */
</ins><span class="cx" style="display: block; padding: 0 10px">                 foreach ( static::ELEMENTS as $el_name => $el_selector ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        $element_selector = array();
</span><span class="cx" style="display: block; padding: 0 10px">                        foreach ( $block_selectors as $selector ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3554,8 +3592,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $settings = _wp_array_get( $this->theme_json, array( 'settings' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                foreach ( $metadata['selectors'] as $feature => $feature_selectors ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        // Skip if this is the block's root selector or the block doesn't
-                       // have any styles for the feature.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 /*
+                        * Skip if this is the block's root selector or the block doesn't
+                        * have any styles for the feature.
+                        */
</ins><span class="cx" style="display: block; padding: 0 10px">                         if ( 'root' === $feature || empty( $node[ $feature ] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                continue;
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3566,8 +3606,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                                continue;
</span><span class="cx" style="display: block; padding: 0 10px">                                        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        // Create temporary node containing only the subfeature data
-                                       // to leverage existing `compute_style_properties` function.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 /*
+                                        * Create temporary node containing only the subfeature data
+                                        * to leverage existing `compute_style_properties` function.
+                                        */
</ins><span class="cx" style="display: block; padding: 0 10px">                                         $subfeature_node = array(
</span><span class="cx" style="display: block; padding: 0 10px">                                                $feature => array(
</span><span class="cx" style="display: block; padding: 0 10px">                                                        $subfeature => $node[ $feature ][ $subfeature ],
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3586,15 +3628,19 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                                $declarations[ $subfeature_selector ] = $new_declarations;
</span><span class="cx" style="display: block; padding: 0 10px">                                        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        // Remove the subfeature from the block's node now its
-                                       // styles will be included under its own selector not the
-                                       // block's.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 /*
+                                        * Remove the subfeature from the block's node now its
+                                        * styles will be included under its own selector not the
+                                        * block's.
+                                        */
</ins><span class="cx" style="display: block; padding: 0 10px">                                         unset( $node[ $feature ][ $subfeature ] );
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        // Now subfeatures have been processed and removed we can process
-                       // feature root selector or simple string selector.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 /*
+                        * Now subfeatures have been processed and removed we can process
+                        * feature root selector or simple string selector.
+                        */
</ins><span class="cx" style="display: block; padding: 0 10px">                         if (
</span><span class="cx" style="display: block; padding: 0 10px">                                is_string( $feature_selectors ) ||
</span><span class="cx" style="display: block; padding: 0 10px">                                ( isset( $feature_selectors['root'] ) && $feature_selectors['root'] )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3601,16 +3647,20 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                $feature_selector = is_string( $feature_selectors ) ? $feature_selectors : $feature_selectors['root'];
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                // Create temporary node containing only the feature data
-                               // to leverage existing `compute_style_properties` function.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         /*
+                                * Create temporary node containing only the feature data
+                                * to leverage existing `compute_style_properties` function.
+                                */
</ins><span class="cx" style="display: block; padding: 0 10px">                                 $feature_node = array( $feature => $node[ $feature ] );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                // Generate the style declarations.
</span><span class="cx" style="display: block; padding: 0 10px">                                $new_declarations = static::compute_style_properties( $feature_node, $settings, null, $this->theme_json );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                // Merge new declarations with any that already exist for
-                               // the feature selector. This may occur when multiple block
-                               // support features use the same custom selector.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         /*
+                                * Merge new declarations with any that already exist for
+                                * the feature selector. This may occur when multiple block
+                                * support features use the same custom selector.
+                                */
</ins><span class="cx" style="display: block; padding: 0 10px">                                 if ( isset( $declarations[ $feature_selector ] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                        foreach ( $new_declarations as $new_declaration ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                                $declarations[ $feature_selector ][] = $new_declaration;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3619,8 +3669,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                        $declarations[ $feature_selector ] = $new_declarations;
</span><span class="cx" style="display: block; padding: 0 10px">                                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                // Remove the feature from the block's node now its styles
-                               // will be included under its own selector not the block's.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         /*
+                                * Remove the feature from the block's node now its styles
+                                * will be included under its own selector not the block's.
+                                */
</ins><span class="cx" style="display: block; padding: 0 10px">                                 unset( $node[ $feature ] );
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span></span></pre>
</div>
</div>

</body>
</html>