Generated differential CSS corpus for the PHP transformer
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 15/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- php
- Domain
- testing-qa, tooling
Research direction
Start from php-transformer/tools/visual-parity/tests/inline-declaration-priority.mjs, which shows the transform-and-render-in-Chromium comparison at 390px and 1440px that the corpus would reuse. The work is a seeded generator of small pages with a <style> block, a batched PHP runner, a JSON report, and a README, so 'done' means the four acceptance points hold, including reproducing the #1914, #2183, #1837 and #1941 families. Scope and feature catalog need maintainer agreement before coding.
Written by the indexing model from the issue text.
Description
Problem
Most transformer defects are found by importing real sites. A random sample of 100 merged fix PRs across Blocks Engine, Static Site Importer and Data Liberation Agent (since 2026-08-18) found that 61 of 63 defects reproduce on a small synthetic page. Many are core CSS behavior rather than site-specific shapes:
- #1914:
:where()contents counted toward specificity - #2183: custom property names lowercased
- #1837: custom properties declared inside a media query skipped by
var()resolution - #1941: grid items keeping their automatic minimum size
Because these are core CSS semantics, they can be enumerated ahead of time. Finding them one customer URL at a time is slow and expensive.
php-transformer/tools/visual-parity/tests/ already has the right primitive. inline-declaration-priority.mjs transforms HTML with the PHP transformer, renders source and output in Chromium at 390px and 1440px, and asserts equal computed style and box per element. There are 27 of these tests, each hand-written for one case.
Proposal
A generated differential corpus over that primitive:
- Grammar. A deterministic, seeded generator of small standalone pages: a few elements plus a
<style>block, combining one or two features from a declared catalog. Slice 1 covers these feature families:- Selectors: descendant, child, sibling and adjacent-sibling combinators;
:where()/:is()/:not(); attribute selectors; specificity ties. - Cascade: source order,
!important(inline and stylesheet),@layer,@media, custom properties (case, fallbacks, scope, declared inside@media). - Layout: block flow and margin collapse, flex, grid (template, automatic minimum size, gap), positioning,
aspect-ratio. - Box model and typography: shorthands vs longhands, logical properties, units (
em/rem/%/vw/clamp()),line-height, inheritance. - Common recognizer inputs: headings, lists, figures with captions, links styled as buttons, and image-and-text pairs.
- Selectors: descendant, child, sibling and adjacent-sibling combinators;
- Runner. For each generated case, transform once in PHP and render source and output in Chromium at the existing viewports. Compare computed style for a declared property set, plus the box of every marked source element. Batch the PHP calls in one process so the corpus runs in minutes.
- Report, not gate. Emit a JSON report per run: seed, case id, feature tags, pass or fail, and the per-element and per-property diff. Group failures by feature tags so each group is one candidate issue. It does not gate CI yet; the first runs are expected to find failures.
- Promotion. A failing case can be written out as a standalone visual-parity test or fixture, so that once its fix lands it becomes a permanent regression test.
Acceptance
- Same seed gives the same cases and the same report.
- Each case is at most about 15 elements and a few rules, small enough to read in an issue.
- The generator reproduces at least the families of #1914, #2183, #1837 and #1941: with the fix reverted the case fails, and on trunk it passes.
- A full default run completes in under 10 minutes locally.
- The README explains how to run it, read the report, add a feature family, and promote a failing case.
Related: Automattic/static-site-importer#2107 reduces failures found on real sites to the same kind of minimal case. Together they let real sites act as seeds rather than the test bench.
AI disclosure: Drafted by Claude (Anthropic) running in the Pi coding agent, operated by @chubes4. The model sampled and classified the 100 PRs from their titles and descriptions (not their diffs), found the existing visual-parity test primitive, and wrote this proposal. A human reviewed it before posting.
- Dominant language
- PHP
- Stars
- 21
- Forks
- 2
- Avg merge
- 8h 35m
- Merged PRs (30d)
- 659
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Automattic/blocks-engine
-
Solved site promotion gate fails on runner PHP patch drift (expects 8.2.33, runner installs 8.2.34)Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Automattic/blocks-engine#2161 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Automattic/blocks-engine#2061 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Automattic/blocks-engine#1701 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Automattic/blocks-engine#775 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
Automattic/blocks-engine#3024 · 1 comment ·
Maintainers usually reply within 1 day
All issues in Automattic/blocks-engine
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
opnsense/core#11052 · 1 comment ·
Maintainers usually reply within 1 day
-
needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
grokability/snipe-it#19857 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
Maintainers usually reply within 1 day