Skip to content

refactor(php-transformer): move inert element recognition into Elements/InertElements - #5275

Merged
chubes4 merged 2 commits into
trunkfrom
simplify/inert-elements
Nov 9, 2026
Merged

chubes4 merged 2 commits into
trunkfrom
simplify/inert-elements

Conversation

@chubes4

@chubes4 chubes4 commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Part of #4368 (slice 2y).

What

  • New owner, Elements/InertElements. It recognizes source elements that are inert on the page. Moved verbatim out of HtmlCompilation:
    • isInertRuntimeMediaPlaceholder: runtime media placeholders that never paint.
    • isInertHiddenSvgStorage and hiddenSvgStoreHasNonSvgConsumer: hidden SVG sprite stores that only other SVG content consumes.
  • Mechanical substitutions only: SourceDom::attr replaces the trait forward, and collaborators are injected. The three existing closures (PhrasingSvgConverter, the hidden-SVG predicate and VisualIframeBlockGenerator) now call the new owner.

HtmlCompilation: 7130 → 7037 lines.

Verification

  • Lab gate (composer validate --strict && lint && test:lint && test): GATE=0.
  • Two concurrent A/B rounds of the rj/website compile, trunk 530cf33f vs this branch 419adb95, with HEADs asserted: output_sha256 49442575…9377 on all 4 outputs, byte-identical.

AI disclosure: Claude Opus (Anthropic) via Pi/Roadie moved the code with a mechanical mover script, ran the Lab gate and A/B, and wrote this PR for Chris Huber.

…ts/InertElements

Moves isInertRuntimeMediaPlaceholder, isInertHiddenSvgStorage and
hiddenSvgStoreHasNonSvgConsumer out of HtmlCompilation verbatim.
@chubes4
chubes4 merged commit 619e71f into trunk Nov 9, 2026
13 checks passed
@chubes4
chubes4 deleted the simplify/inert-elements branch November 9, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant