\s*$/', '', $content, 1 );
+ }
+ return $content;
}
}
$attributes = $block['attrs']['metadata']['blocksEngineRuntimeAttributes'] ?? null;
diff --git a/php-transformer/src/WordPressSitePlan/ThemeBootstrap.php b/php-transformer/src/WordPressSitePlan/ThemeBootstrap.php
index 15795685f..15afae3f2 100644
--- a/php-transformer/src/WordPressSitePlan/ThemeBootstrap.php
+++ b/php-transformer/src/WordPressSitePlan/ThemeBootstrap.php
@@ -516,7 +516,7 @@ public static function functionsPhp(array $assets, array $scripts = array(), arr
$breadcrumbLabels = BreadcrumbLabelRuntime::labels($documents, $pages);
$breadcrumbPostTrails = BreadcrumbLabelRuntime::postTrails($pages);
if (array() !== $breadcrumbLabels || array() !== $breadcrumbPostTrails) $lines[] = BreadcrumbLabelRuntime::source($breadcrumbLabels, $breadcrumbPostTrails);
- if (self::markupContains($documentsWithMenus, 'blocksEngineRuntimeAttributes')) {
+ if (self::markupContains($documentsWithMenus, 'blocksEngineRuntimeAttributes') || self::markupContains($documentsWithMenus, 'blocksEngineControlBox')) {
$lines[] = RuntimeAttributesRuntime::source();
}
foreach (EditorRestingStateRuntime::MARKERS as $marker) {
diff --git a/php-transformer/tests/unit/button-shared-display.php b/php-transformer/tests/unit/button-shared-display.php
new file mode 100644
index 000000000..2d190e5aa
--- /dev/null
+++ b/php-transformer/tests/unit/button-shared-display.php
@@ -0,0 +1,24 @@
+.action{display:inline-flex;padding:14px 26px;background:red}
',
+ (string) file_get_contents(dirname(__DIR__) . '/fixtures/button-intrinsic-height.html'),
+);
+foreach ($pages as $html) {
+ $result = (new HtmlTransformer())->transform($html)->toArray();
+ $css = implode('', array_column(array_filter($result['assets'], static fn(array $a): bool => 'css' === ($a['kind'] ?? '')), 'content'));
+ $restore = ':where(.blocks-engine-layout-child-button.blocks-engine-layout-child-button-display-inline-flex)>.wp-block-button__link{display:inline-flex!important}';
+ if (!str_contains($css, $restore)) {
+ throw new RuntimeException('Every route support sheet must restore inline-flex source buttons');
+ }
+ if (strpos($css, $restore) < strpos($css, 'display:inline!important')) {
+ throw new RuntimeException('Source display restoration must follow the generic inline reset');
+ }
+}
+echo "Shared button source display: passed\n";
diff --git a/php-transformer/tests/unit/native-button-ownership.php b/php-transformer/tests/unit/native-button-ownership.php
new file mode 100644
index 000000000..9f49dc112
--- /dev/null
+++ b/php-transformer/tests/unit/native-button-ownership.php
@@ -0,0 +1,39 @@
+
' => '
',
+ '
' => 'aria-controls="panel"',
+);
+foreach ($cases as $source => $nativeMarkup) {
+ $result = (new HtmlTransformer())->transform('' . $source)->toArray();
+ $markup = $result['serialized_blocks'];
+ if (!str_contains($markup, $nativeMarkup) || str_contains($markup, 'blocksEngineControlLabel')) {
+ throw new RuntimeException('Native control ownership was bypassed: ' . $markup);
+ }
+}
+// Captured native forms own their controls too, but their plain actions
+// must expose editable Core labels while keeping the original native box.
+foreach (array('button', 'reset', 'submit') as $type) {
+ $result = (new HtmlTransformer())->transform(
+ ''
+ . '
'
+ )->toArray();
+ $markup = $result['serialized_blocks'];
+ if (str_contains($markup, '/authored-button')
+ || !str_contains($markup, '