ADR 0005 slice 5: fold style-only single-child boxes into their child

オープン
#6,240 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
php
領域
backend

調査の方向性

Start by reading ADR 0005 (#6160) and slice 4 (#6239), then inspect the classifier and parity checks for the Wix capture. Implement the geometry-proven fold rules and add the requested table-driven contract test with one fold and one refusal per rule. Done means reporting per-route fold counts, meeting the depth and groups-per-leaf targets, and preserving desktop and mobile parity with slice 4.

索引モデルが issue の本文から書いたものです。

説明

Slice 5 of ADR 0005 (#6160). Depends on slice 4 (https://github.com/Automattic/blocks-engine/issues/6239).

Goal: fold single-child boxes that are load-bearing only because of their own styles into that child, proved by geometry. Once the engine owns every rule (slice 3), moving a declaration is safe, because no author selector depends on the box.

Fold rules: each applies only when the box has exactly one child, no semantics, references, interaction or motion, and the result is proved at every captured viewport:

  • Own sizing (padding): the box's padding becomes the child's margin when the child is block-level, has no margin on that side, and the child's border box sits exactly inside the box's padding edge. Sizing constraints (width, max-width, min-height) move only when the child's used size is already equal.
  • Paint: background, border, radius or shadow moves to the child when the child's border box equals the box's border box and the child doesn't paint on those properties.
  • Containing block: position:relative moves to the child when every positioned descendant's offsets resolve to the same rectangle (the child's border box equals the box's).
  • Never fold: clipping, multi-child layout, semantic tags, transforms, filters or opacity (they create stacking contexts), or pseudo-elements that render.

Measured today (classifier on the Wix capture, structural boxes): Home 258 (109 neutral; 38 own-sizing, 21 paint, 22 containing-block). About 110 (44 neutral; 16, 10, 5). The ceiling after slice 5 is about 68 structural boxes on Home, roughly 70% fewer wrappers.

Acceptance:

  • Report the fold count per rule per route, plus emitted depth and groups per leaf. The ADR targets are depth ≤ 10 and groups per leaf ≤ 1.1.
  • Desktop and mobile parity against slice 4 shows no regression.
  • One table-driven contract test, with one fold and one refusal per rule.

AI disclosure: written by Franklin (Claude Opus via Pi, Roadie).

主要言語
PHP
スター
28
フォーク
5
平均マージ
2時間 59分
マージ済み PR(30日)
942

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Automattic/blocks-engine のほかの issue

Automattic/blocks-engine の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。